Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #137339

Closed
wants to merge 39 commits into from

Conversation

workingjubilee
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

kulst and others added 30 commits February 16, 2025 21:57
Bitcode linkers like llvm-bitcode-linker or bpf linker hand over the target features to llvm during link stage. During link stage the `TyCtxt` is already gone so it is not possible to create a query for the global backend features any longer. The features preserved in `Session.target_features` only incorporate target features known to rustc. This would contradict with the behaviour during codegen stage which also passes target features to llvm which are unknown to rustc.
This commit adds target features as a field to the `CrateInfo` struct and queries the target features in its new function. This way the target features are preserved beyond tcx and available at link stage.
To make sure the `global_backend_features` query is always registered even if the CodegenBackend does not register it, this registration is added to the `provide`function of the `rustc_codegen_ssa` crate.
The .ptx version produced by llc can be specified by passing it with --mattr. Currently it is not possible to specify the .ptx version with -Ctarget-feature because these are not passed through to llvm-bitcode-linker and handled by it. This commit adds both.
--target-feature and -mattr are passed with equals to mitigate issues when the value starts with a - (minus).
This commit removes the `avr-unknown-gnu-atmega328` target and replaces
it with a more generic `avr-none` variant that must be specialized with
the `-C target-cpu` flag (e.g. `-C target-cpu=atmega328p`).
Currently many of them exceed 100 chars, which makes them painful to
read on a terminal that is 100 chars wide.
I found the dialect/phase distinction quite confusing when I first read
these comments. This commit clarifies things a bit.
The only visible change is to the filenames produce by `-Zdump-mir`.
E.g. before and after:
```
h.main.003-000.analysis-post-cleanup.after.mir
h.main.2-2-000.analysis-post-cleanup.after.mir
```
It also fixes a FIXME comment.
`Postorder` has a `C: Customization<'tcx>` parameter, that gives it
flexibility about how it computes successors. But in practice, there are
only two `impls` of `Customization`, and one is for the unit type.

This commit simplifies things by removing the generic parameter and
replacing it with an `Option`.
The locations of these files have since been changed. This is a simple
change to update the references to these files.
… 128bit

While it would technically be possible to workaround this in cg_clif, it
quickly becomes very messy and would likely cause correctness issues.
Working around it in rustc instead is much simper and won't have any
negative impact for code running on stable as vectors smaller than
128bit can only be made on nightly using core::simd or #[repr(simd)].
LLVM 20 enabled the `nontrapping-fptoint` and `bulk-memory` features by
default, so this updates the corresponding documentation for the
`wasm32-*` targets (which all point to `wasm32-unknown-unknown`).

cc rust-lang#137315
…l` field in `LayoutData`.

Also update comments that refered to BackendRepr::Uninhabited.
…turn ABI as wrapped type.

Fix codegen of uninhabited PassMode::Indirect return types.

Add codegen test for uninhabited PassMode::Indirect return types.

Enable optimizations for uninhabited return type codegen test
Co-authored-by: Jubilee <workingjubilee@gmail.com>
…ross35

Create a generic AVR target: avr-none

This commit removes the `avr-unknown-gnu-atmega328` target and replaces it with a more generic `avr-none` variant that must be specialized using `-C target-cpu` (e.g. `-C target-cpu=atmega328p`).

Seizing the day, I'm adding myself as the maintainer of this target - I've been already fixing the bugs anyway, might as well make it official 🙂

Related discussions:
- rust-lang#131171
- rust-lang/compiler-team#800

try-job: x86_64-gnu-debug
…chenkov

infer linker flavor by linker name if it's sufficiently specific

Fix: `rustc` does not infer `llvm-bitcode-linker` uses `llbc` linker flavor if targeting `nvptx64-nvidia-cuda`.
Pass through of target features to llvm-bitcode-linker and handling them

When using the llvm-bitcode-linker (`linker-flavor=llbc`) target-features are not passed through and are not handled by it.
The llvm-bitcode-linker is mainly used as a self contained linker to link llvm bitcode for the nvptx64 target. It uses `llvm-link`, `opt` and `llc` internally. To produce a `.ptx` file of a specific ptx-version it is necessary to pass the version to llc with the `--mattr` option. Without explicitly setting it, the emitted `.ptx`-version is the minimum supported version of the `--target-cpu`.

I would like to be able to explicitly set the ptx version as [some llvm problems only occur in earlier `.ptx`-versions](llvm/llvm-project#112998).

Therefore this pull request adds support for passing target features to llvm-bitcode-linker and handling them.
I was not quite sure if adding these features to `rustc_target/src/target_features.rs` is necessary or not. If so I will gladly add these.

    r? `@kjetilkjeka`
…bited, r=workingjubilee

Do not ignore uninhabited types for function-call ABI purposes. (Remove BackendRepr::Uninhabited)

Accepted MCP: rust-lang/compiler-team#832

Fixes rust-lang#135802

Do not consider the inhabitedness of a type for function call ABI purposes.

* Remove the [`rustc_abi::BackendRepr::Uninhabited`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/enum.BackendRepr.html) variant
  * Instead calculate the `BackendRepr` of uninhabited types "normally" (as though they were not uninhabited "at the top level", but still considering inhabitedness of variants to determine enum layout, etc)
* Add an `uninhabited: bool` field to [`rustc_abi::LayoutData`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/struct.LayoutData.html) so inhabitedness of a `LayoutData` can still be queried when necessary (e.g. when determining if an enum variant needs a tag value allocated to it).

This should not affect type layouts (size/align/field offset); this should only affect function call ABI, and only of uninhabited types.

cc `@RalfJung`
…Denton

Remove obsolete Windows ThinLTO+TLS workaround

The bug rust-lang#109797 has been fixed by rust-lang#129079, so this workaround is no longer needed.
Check signature WF when lowering MIR body

Alternative to rust-lang#137233.

rust-lang#137233 (comment)

Fixes rust-lang#137186

We do this check in `mir_drops_elaborated_and_const_checked` and not during `mir_promoted` because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily.

r? lcnr
…tomization, r=compiler-errors

Simplify `Postorder` customization.

`Postorder` has a `C: Customization<'tcx>` parameter, that gives it flexibility about how it computes successors. But in practice, there are only two `impls` of `Customization`, and one is for the unit type.

This commit simplifies things by removing the generic parameter and replacing it with an `Option`.

r? `@saethlin`
Update references to cc_detect.rs

The locations of these file references have since been changed.
This is a simple change to update the references to this `cc_detect.rs`
file.
…chenkov

Some codegen_llvm cleanups

Using some more safe wrappers and thus being able to remove a large unsafe block.

As a next step we should probably look into safe extern fns
…orkingjubilee

Workaround Cranelift not yet properly supporting vectors smaller than 128bit

While it would technically be possible to workaround this in cg_clif, it quickly becomes very messy and would likely cause correctness issues. Working around it in rustc instead is much simper and won't have any negative impact for code running on stable as vectors smaller than 128bit can only be made on nightly using core::simd or #[repr(simd)].
…ieyouxu

Update docs for default features of wasm targets

LLVM 20 enabled the `nontrapping-fptoint` and `bulk-memory` features by default, so this updates the corresponding documentation for the `wasm32-*` targets (which all point to `wasm32-unknown-unknown`).

Closes rust-lang#137315 with a doc update for the doc part.
…6, r=workingjubilee

Make x86 QNX target name consistent with other Rust targets

Rename target to be consistent with other Rust targets: Use `i686` instead of `i586`
See also
- rust-lang#136495
- rust-lang#109173

CC: `@jonathanpallant` `@japaric` `@gh-tr` `@samkearney`
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 20, 2025
@workingjubilee
Copy link
Member Author

what saethlin might call a "brave" rollup

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 20, 2025

📌 Commit f6941de has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2025
@bors
Copy link
Contributor

bors commented Feb 20, 2025

⌛ Testing commit f6941de with merge 2c9b4c5...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 20, 2025
…kingjubilee

Rollup of 14 pull requests

Successful merges:

 - rust-lang#131651 (Create a generic AVR target: avr-none)
 - rust-lang#136473 (infer linker flavor by linker name if it's sufficiently specific)
 - rust-lang#136608 (Pass through of target features to llvm-bitcode-linker and handling them)
 - rust-lang#136985 (Do not ignore uninhabited types for function-call ABI purposes. (Remove BackendRepr::Uninhabited))
 - rust-lang#137192 (Remove obsolete Windows ThinLTO+TLS workaround)
 - rust-lang#137204 (Clarify MIR dialects and phases)
 - rust-lang#137270 (Fix `*-win7-windows-msvc` target since 26eeac1)
 - rust-lang#137298 (Check signature WF when lowering MIR body)
 - rust-lang#137299 (Simplify `Postorder` customization.)
 - rust-lang#137312 (Update references to cc_detect.rs)
 - rust-lang#137313 (Some codegen_llvm cleanups)
 - rust-lang#137318 (Workaround Cranelift not yet properly supporting vectors smaller than 128bit)
 - rust-lang#137322 (Update docs for default features of wasm targets)
 - rust-lang#137324 (Make x86 QNX target name consistent with other Rust targets)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/wasm-custom-section stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-section/rmake_out" && env -u RUSTFLAGS AR="/wasi-sdk-25.0-x86_64-linux/bin/llvm-ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/cargo" CC="/wasi-sdk-25.0-x86_64-linux/bin/wasm32-wasip1-clang" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fno-exceptions --target=wasm32-wasip1" CXX="/wasi-sdk-25.0-x86_64-linux/bin/wasm32-wasip1-clang++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fno-exceptions --target=wasm32-wasip1" HOST_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" NODE="/node/bin/node" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="wasm32-wasip1" TARGET_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-wasip1/lib" TARGET_RPATH_ENV="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-section/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-section/rmake"
--- stderr -------------------------------
command failed at line 8
command failed at line 8
Command { cmd: LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-section/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-section/rmake_out" "foo.rs" "--target=wasm32-wasip1", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc", defused: true, armed_location: Location { file: "/checkout/tests/run-make/wasm-custom-section/rmake.rs", line: 8, col: 5 } }, already_executed: true }
output status: `exit status: 1`
=== STDOUT ===


=== STDERR ===
error[E0391]: cycle detected when checking that `A` is well-formed
error[E0391]: cycle detected when checking that `A` is well-formed
##[error] --> foo.rs:5:1
  |
5 | pub static A: [u8; 2] = [1, 2];
  |
  |
note: ...which requires evaluating initializer of static `A`...
  |
  |
5 | pub static A: [u8; 2] = [1, 2];
  | ^^^^^^^^^^^^^^^^^^^^^
note: ...which requires caching mir of `A` for CTFE...
  |
  |
5 | pub static A: [u8; 2] = [1, 2];
  | ^^^^^^^^^^^^^^^^^^^^^
note: ...which requires elaborating drops for `A`...
  |
  |
5 | pub static A: [u8; 2] = [1, 2];
  | ^^^^^^^^^^^^^^^^^^^^^
  = note: ...which again requires checking that `A` is well-formed, completing the cycle
note: cycle used when checking that types are well-formed in top-level module
  |
1 | / #![crate_type = "rlib"]
2 | | #![deny(warnings)]
3 | |
3 | |
4 | | #[link_section = "foo"]
... |
7 | | #[link_section = "bar"]
8 | | pub static B: [u8; 2] = [3, 4];
  | |_______________________________^
  = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0391]: cycle detected when checking that `B` is well-formed
##[error] --> foo.rs:8:1
  |
  |
8 | pub static B: [u8; 2] = [3, 4];
  |
  |
note: ...which requires evaluating initializer of static `B`...
  |
  |
8 | pub static B: [u8; 2] = [3, 4];
  | ^^^^^^^^^^^^^^^^^^^^^
note: ...which requires caching mir of `B` for CTFE...
  |
  |
8 | pub static B: [u8; 2] = [3, 4];
  | ^^^^^^^^^^^^^^^^^^^^^
note: ...which requires elaborating drops for `B`...
  |
  |
8 | pub static B: [u8; 2] = [3, 4];
  | ^^^^^^^^^^^^^^^^^^^^^
  = note: ...which again requires checking that `B` is well-formed, completing the cycle
note: cycle used when checking that types are well-formed in top-level module
  |
1 | / #![crate_type = "rlib"]
2 | | #![deny(warnings)]
3 | |
3 | |
4 | | #[link_section = "foo"]
... |
7 | | #[link_section = "bar"]
8 | | pub static B: [u8; 2] = [3, 4];
  | |_______________________________^
  = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0391`.
------------------------------------------
------------------------------------------


---- [run-make] tests/run-make/wasm-custom-sections-opt stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-sections-opt/rmake_out" && env -u RUSTFLAGS AR="/wasi-sdk-25.0-x86_64-linux/bin/llvm-ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/cargo" CC="/wasi-sdk-25.0-x86_64-linux/bin/wasm32-wasip1-clang" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fno-exceptions --target=wasm32-wasip1" CXX="/wasi-sdk-25.0-x86_64-linux/bin/wasm32-wasip1-clang++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fno-exceptions --target=wasm32-wasip1" HOST_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" NODE="/node/bin/node" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="wasm32-wasip1" TARGET_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-wasip1/lib" TARGET_RPATH_ENV="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-sections-opt/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-sections-opt/rmake"
--- stderr -------------------------------
command failed at line 9
command failed at line 9
Command { cmd: LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-sections-opt/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-custom-sections-opt/rmake_out" "foo.rs" "--target=wasm32-wasip1" "-O", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc", defused: true, armed_location: Location { file: "/checkout/tests/run-make/wasm-custom-sections-opt/rmake.rs", line: 9, col: 5 } }, already_executed: true }
output status: `exit status: 1`
=== STDOUT ===


=== STDERR ===
error[E0391]: cycle detected when checking that `A` is well-formed
error[E0391]: cycle detected when checking that `A` is well-formed
##[error]  --> foo.rs:5:1
   |
5  | pub static A: [u8; 2] = [1, 2];
   |
   |
note: ...which requires evaluating initializer of static `A`...
   |
   |
5  | pub static A: [u8; 2] = [1, 2];
   | ^^^^^^^^^^^^^^^^^^^^^
note: ...which requires caching mir of `A` for CTFE...
   |
   |
5  | pub static A: [u8; 2] = [1, 2];
   | ^^^^^^^^^^^^^^^^^^^^^
note: ...which requires elaborating drops for `A`...
   |
   |
5  | pub static A: [u8; 2] = [1, 2];
   | ^^^^^^^^^^^^^^^^^^^^^
   = note: ...which again requires checking that `A` is well-formed, completing the cycle
note: cycle used when checking that types are well-formed in top-level module
   |
1  | / #![crate_type = "cdylib"]
2  | | #![deny(warnings)]
3  | |
3  | |
4  | | #[link_section = "foo"]
...  |
20 | |     another::foo();
21 | | }
   | |_^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0391]: cycle detected when checking that `another::FOO` is well-formed
##[error]  --> foo.rs:10:5
   |
   |
10 |     pub static FOO: [u8; 2] = [3, 4];
   |
   |
note: ...which requires evaluating initializer of static `another::FOO`...
   |
   |
10 |     pub static FOO: [u8; 2] = [3, 4];
   |     ^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires caching mir of `another::FOO` for CTFE...
   |
   |
10 |     pub static FOO: [u8; 2] = [3, 4];
   |     ^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires elaborating drops for `another::FOO`...
   |
   |
10 |     pub static FOO: [u8; 2] = [3, 4];
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   = note: ...which again requires checking that `another::FOO` is well-formed, completing the cycle
note: cycle used when checking that types are well-formed in module `another`
   |
8  | pub mod another {
   | ^^^^^^^^^^^^^^^
   | ^^^^^^^^^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0391`.
------------------------------------------

@bors
Copy link
Contributor

bors commented Feb 20, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 20, 2025
@workingjubilee workingjubilee deleted the rollup-esgu55d branch February 20, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.