about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-28add support for ./x check src/tools/linkcheckerPietro Albini-0/+7
2025-07-28Auto merge of #144469 - Kivooeo:chains-cleanup, r=SparrowLiibors-1203/+1109
Some `let chains` clean-up Not sure if this kind of clean-up is welcoming because of size, but I decided to try out one r? compiler
2025-07-28Auto merge of #144556 - matthiaskrgr:rollup-aayo3h5, r=matthiaskrgrbors-464/+641
Rollup of 6 pull requests Successful merges: - rust-lang/rust#143607 (Port the proc macro attributes to the new attribute parsing infrastructure) - rust-lang/rust#144471 (Remove `compiler-builtins-{no-asm,mangled-names}`) - rust-lang/rust#144495 (bump cargo_metadata) - rust-lang/rust#144523 (rustdoc: save target modifiers) - rust-lang/rust#144534 (check_static_item: explain should_check_for_sync choices) - rust-lang/rust#144535 (miri: for ABI mismatch errors, say which argument is the problem) Failed merges: - rust-lang/rust#144536 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-28use let chains in mir, resolve, targetKivooeo-450/+417
2025-07-28use let chains in hir, lint, mirKivooeo-308/+279
2025-07-28use let chains in ast, borrowck, codegen, const_evalKivooeo-445/+413
2025-07-28Rollup merge of #144535 - RalfJung:abi-mismatch-err, r=compiler-errorsMatthias Krüger-35/+45
miri: for ABI mismatch errors, say which argument is the problem
2025-07-28Rollup merge of #144534 - RalfJung:should_check_for_sync, r=compiler-errorsMatthias Krüger-3/+9
check_static_item: explain should_check_for_sync choices Follow-up to https://github.com/rust-lang/rust/pull/144226. r? ``@oli-obk``
2025-07-28Rollup merge of #144523 - ojeda:rustdoc-target-modifiers, r=GuillaumeGomezMatthias Krüger-0/+53
rustdoc: save target modifiers `rustdoc` was filling a `target_modifiers` variable, but it was not using the result. In turn, that means that trying to use a dependency that set a target modifier fails. For instance, running: ```sh RUSTC_BOOTSTRAP=1 rustc --edition=2024 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null --emit=metadata -Zfixed-x18 --crate-type rlib --crate-name core $(rustc --print sysroot)/lib/rustlib/src/rust/library/core/src/lib.rs echo '#![allow(internal_features)] ' | RUSTC_BOOTSTRAP=1 rustdoc --edition=2021 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null -Zfixed-x18 --extern core=libcore.rmeta - ``` will fail with: ```text error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `rust_out` | = help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely = note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `core` = help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `core` = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error ``` Thus save the targets modifiers in `Options` to then pass it to the session options, so that eventually the diff can be performed as expected in `report_incompatible_target_modifiers()`. Cc: ``@azhogin`` Fixes: https://github.com/rust-lang/rust/issues/144521
2025-07-28Rollup merge of #144495 - klensy:cargo_metadata, r=lqdMatthias Krüger-27/+14
bump cargo_metadata Bumps cargo_metadata. Change that required fixes is: https://github.com/oli-obk/cargo_metadata/commit/e3373d02e79dc64adbecb3fe32fecc1dd324bba6
2025-07-28Rollup merge of #144471 - tgross35:compiler-builtins-asm, r=AmanieuMatthias Krüger-6/+0
Remove `compiler-builtins-{no-asm,mangled-names}` Remove `compiler-builtins-no-asm` This feature used to be for when Cranelift didn't support inline assembly, but its last uses were removed in 52933e0bd200 ("Don't disable inline asm usage in compiler-builtins when the cranelift backend is enabled"). and cba05a7a14b3 ("Support naked functions"). This doesn't remove the feature from the `compiler-builtins` crate, that will be done separately in the subtree repo. --- Remove `compiler-builtins-mangled-names` This config was added in 207de019dc67 ("libary: Forward compiler-builtins "asm" and "mangled-names" feature") but it does not appear this has ever been used. The PR adding it (rust-lang/rust#78472) says that this was exposed to help with configuration and points at the [Hermit Cargo config], but as far as I can tell, this feature name has never been mentioned in that repository's git history. Thus, clean up a seemingly unneeded feature. [Hermit Cargo config]: https://github.com/hermit-os/hermit-rs/blob/ab2b830930e6a9a98c8294997a8183feeabeda4a/.cargo/config
2025-07-28Rollup merge of #143607 - JonathanBrouwer:proc_macro_attrs, ↵Matthias Krüger-393/+520
r=jdonszelmann,traviscross Port the proc macro attributes to the new attribute parsing infrastructure Ports `#[proc_macro]`, `#[proc_macro_attribute]`, `#[proc_macro_derive]` and `#[rustc_builtin_macro]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 I've split this PR into commits for reviewability, and left some comments to clarify things I did 4 related attributes in one PR because they share a lot of their code and logic, and doing them separately is kind of annoying as I need to leave both the old and new parsing in place then. r? ``@oli-obk`` cc ``@jdonszelmann``
2025-07-27Auto merge of #144225 - purplesyringa:unwinding-intrinsics, r=nikicbors-10/+25
Don't special-case llvm.* as nounwind Certain LLVM intrinsics, such as `llvm.wasm.throw`, can unwind. Marking them as nounwind causes us to skip cleanup of locals and optimize out `catch_unwind` under inlining or when `llvm.wasm.throw` is used directly by user code. The motivation for forcibly marking llvm.* as nounwind is no longer present: most intrinsics are linked as `extern "C"` or other non-unwinding ABIs, so we won't codegen `invoke` for them anyway. Closes rust-lang/rust#132416. `@rustbot` label +T-compiler +A-panic
2025-07-27miri: for ABI mismatch errors, say which argument is the problemRalf Jung-35/+45
2025-07-27Auto merge of #144434 - nnethercote:preintern-ty-bounds, r=compiler-errorsbors-9/+38
Preintern some `TyKind::Bound` values The new trait solver produces a lot of these. r? `@compiler-errors`
2025-07-27Auto merge of #144425 - nnethercote:avoid-new_adt-new_fn_def, r=compiler-errorsbors-4/+12
Avoid unnecessary `new_adt`/`new_fn_def` calls. They can be skipped if there are no arguments, avoiding the "relate" operation work and also the subsequent interning. r? `@ghost`
2025-07-27check_static_item: explain should_check_for_sync choicesRalf Jung-3/+9
2025-07-27Auto merge of #143884 - LorrensP-2158466:resolve-split-define, r=petrochenkovbors-57/+100
Resolve: refactor `define` into `define_local` and `define_extern` Follow up on rust-lang/rust#143550 and part of [#gsoc > Project: Parallel Macro Expansion](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/with/527348747). Split up `define` into `define_local` and `define_extern`. Refactor usages of `define` into either one where it's "correct" (idk if everything is correct atm). Big part of this is that `resolution` can now take a `&Resolver` instead of a mutable one. r? `@petrochenkov`
2025-07-27split up define into define_extern and define_localLorrensP-2158466-57/+100
2025-07-27bump cargo_metadataklensy-27/+14
2025-07-27Auto merge of #144528 - matthiaskrgr:rollup-felcjc1, r=matthiaskrgrbors-399/+275
Rollup of 4 pull requests Successful merges: - rust-lang/rust#144226 (Do not assert layout in KnownPanicsLint.) - rust-lang/rust#144385 (Optimize performance by inline in macro hygiene system) - rust-lang/rust#144454 (move uefi test to run-make) - rust-lang/rust#144455 (Unify LLVM ctlz/cttz intrinsic generation) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-27Rollup merge of #144455 - TDecking:ctlz-cttz, r=SparrowLiiMatthias Krüger-19/+9
Unify LLVM ctlz/cttz intrinsic generation The type signature for `llvm.ctlz` is the same as the one for `llvm.cttz`, which enables a small simplification.
2025-07-27Rollup merge of #144454 - folkertdev:uefi-tests, r=jieyouxuMatthias Krüger-151/+90
move uefi test to run-make Turn the `uefi` test into a more standard `run-make` test, and execute it using the `test-various` CI job like before. This is just a straightforward translation of the python code, but using `run-make` to supply the target (hence the 3 separate calls in the docker file). r? ```@jieyouxu``` cc ```@nicholasbishop``` try-job: test-various
2025-07-27Rollup merge of #144385 - xizheyin:macro-hygiene, r=petrochenkovMatthias Krüger-0/+17
Optimize performance by inline in macro hygiene system I inline some small method in `rustc_span/src/hygiene.rs` and so on.
2025-07-27Rollup merge of #144226 - cjgillot:known-panics-panics, r=oli-obkMatthias Krüger-229/+159
Do not assert layout in KnownPanicsLint. Fixes rust-lang/rust#121176 Fixes rust-lang/rust#129109 Fixes rust-lang/rust#130970 Fixes rust-lang/rust#131347 Fixes rust-lang/rust#139872 Fixes rust-lang/rust#140332
2025-07-27Auto merge of #144347 - scottmcm:ssa-enums-v0, r=WaffleLapkinbors-64/+110
No longer need `alloca`s for consuming `Result<!, i32>` and similar In optimized builds GVN gets rid of these already, but in `opt-level=0` we actually make `alloca`s for this, which particularly impacts `?`-style things that use actually-only-one-variant types like this. While doing so, rewrite `LocalAnalyzer::process_place` to be non-recursive, solving a 6+ year old FIXME. r? codegen
2025-07-27rustdoc: save target modifiersMiguel Ojeda-0/+53
`rustdoc` was filling a `target_modifiers` variable, but it was not using the result. In turn, that means that trying to use a dependency that set a target modifier fails. For instance, running: ```sh RUSTC_BOOTSTRAP=1 rustc --edition=2024 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null --emit=metadata -Zfixed-x18 --crate-type rlib --crate-name core $(rustc --print sysroot)/lib/rustlib/src/rust/library/core/src/lib.rs echo '#![allow(internal_features)] ' | RUSTC_BOOTSTRAP=1 rustdoc --edition=2021 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null -Zfixed-x18 --extern core=libcore.rmeta - ``` will fail with: ```text error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `rust_out` | = help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely = note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `core` = help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `core` = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error ``` Thus save the targets modifiers in `Options` to then pass it to the session options, so that eventually the diff can be performed as expected in `report_incompatible_target_modifiers()`. Fixes: https://github.com/rust-lang/rust/issues/144521 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-07-27Auto merge of #144526 - jhpratt:rollup-1x1tyvn, r=jhprattbors-401/+633
Rollup of 13 pull requests Successful merges: - rust-lang/rust#141840 (If `HOME` is empty, use the fallback instead) - rust-lang/rust#144359 (add codegen test for variadics) - rust-lang/rust#144379 (test using multiple c-variadic ABIs in the same program) - rust-lang/rust#144383 (disable cfg.has_reliable_f128 on amdgcn) - rust-lang/rust#144409 (Stop compilation early if macro expansion failed) - rust-lang/rust#144422 (library/windows_targets: Fix macro expansion error in 'link' macro) - rust-lang/rust#144429 (Enable outline-atomics for aarch64-unknown-linux-musl) - rust-lang/rust#144430 (tests: aarch64-outline-atomics: Remove hardcoded target) - rust-lang/rust#144445 (Fix `./x check bootstrap` (again)) - rust-lang/rust#144453 (canonicalize build root in `tests/run-make/linker-warning`) - rust-lang/rust#144464 (Only run bootstrap tests in `x test` on CI) - rust-lang/rust#144470 (clif: Don't set the `compiler-builtins-no-f16-f128` feature) - rust-lang/rust#144480 (Revert "coverage: Enlarge empty spans during MIR instrumentation, not codegen") r? `@ghost` `@rustbot` modify labels: rollup
2025-07-26Rollup merge of #144480 - Zalathar:revert-empty-span, r=ZalatharJacob Pratt-57/+46
Revert "coverage: Enlarge empty spans during MIR instrumentation, not codegen" Surprisingly, rust-lang/rust#144298 alone (extracted from rust-lang/rust#140847) was enough to re-trigger the failures observed in https://github.com/rust-lang/rust/issues/141577#issuecomment-3120667286. --- This reverts commit f877aa7d14916f71a2f88c6d4c009e7ded7684c4. --- r? ghost
2025-07-26Rollup merge of #144470 - tgross35:clif-remove-no-f16-f128, r=bjorn3Jacob Pratt-5/+0
clif: Don't set the `compiler-builtins-no-f16-f128` feature Since rust-lang/rust be35d37d8b6c ("Use the compiler to determine whether or not to enable f16 and f128"), `compiler-builtins` relies on `rustc` to report whether or not `f16` and `f128` are supported, which is reported by the backend. This means that there should no longer be any need to unconditionally disable the types for clif in Bootstrap. Backend config: https://github.com/rust-lang/rust/blob/a955f1cd09a027363729ceed919952d09f76f28e/compiler/rustc_codegen_cranelift/src/lib.rs#L224-L233
2025-07-26Rollup merge of #144464 - Kobzol:x-test-default, r=jieyouxuJacob Pratt-1/+5
Only run bootstrap tests in `x test` on CI Discussed at https://rust-lang.zulipchat.com/#narrow/channel/122652-new-members/topic/Linux.20Distribution/with/530839642. The bootstrap tests can be sensitive of the environment where they are executed. And now that they are executed very early in the test pipeline, it can be annoying for people who just try to do `x test` when it fails on bootstrap tests. We could move the bootstrap tests back to the end of the `x test` pipeline, but then it would just fail later. I'd prefer to only run them on CI by default. Fixes: https://github.com/rust-lang/rust/issues/143973
2025-07-26Rollup merge of #144453 - WaffleLapkin:canonical-build-root, r=jieyouxuJacob Pratt-1/+3
canonicalize build root in `tests/run-make/linker-warning` r? jieyouxu This is similar to rust-lang/rust#139823 -- the test fails for me because my build dir is a symlink.
2025-07-26Rollup merge of #144445 - jieyouxu:revert-shared_helpers_tests, r=KobzolJacob Pratt-11/+23
Fix `./x check bootstrap` (again) Redoes rust-lang/rust#134883 and reverts 40c2ca96411caaeab1563ff9041879f742d1d71b from rust-lang/rust#142416. Unfortunately I missed this during review. - Commit 1: Reverts 40c2ca96411caaeab1563ff9041879f742d1d71b and re-applies rust-lang/rust#134883. - Commit 2: Check `./x check bootstrap` in `pr-check-1` to catch "obvious" problems like this. r? Kobzol
2025-07-26Rollup merge of #144430 - Gelbpunkt:aarch64-outline-atomics-target, r=NoratriebJacob Pratt-2/+0
tests: aarch64-outline-atomics: Remove hardcoded target Since this test is limited to aarch64 and linux hosts, the `--target` flag is entirely unnecessary and only breaks this on musl hosts. Let the compiler use the default target instead.
2025-07-26Rollup merge of #144429 - Gelbpunkt:outline-atomics-aarch64-musl, r=AmanieuJacob Pratt-1/+1
Enable outline-atomics for aarch64-unknown-linux-musl They were disabled in bd287fa5084f2e153c1044632f9f3d190f090d69 and haven't been causing problems for a while anymore, see https://github.com/rust-lang/rust/issues/89626 for details. The entire testsuite still passes on `aarch64-unknown-linux-musl` with this feature enabled.
2025-07-26Rollup merge of #144422 - itf:itf-patch-2-1, r=ChrisDentonJacob Pratt-13/+3
library/windows_targets: Fix macro expansion error in 'link' macro A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in rust-lang/rust#143592 This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon". We add a semicolon to the line causing the issue as we also modify the non windows_raw_dylib link to make use of the link_dylib macro
2025-07-26Rollup merge of #144409 - GuillaumeGomez:macro-expansion-early-abort, r=oli-obkJacob Pratt-249/+323
Stop compilation early if macro expansion failed Fixes rust-lang/rust#116180. So there isn't really a type that is central for macro expansion and some errors are actually emitted (because the resolution happens after the expansion I suppose) after the expansion pass (like "not found macro"). Sometimes, errors are only emitted on the second "try" (to improve error output). So I couldn't reach a similar solution than what was done in https://github.com/rust-lang/rust/pull/133937 and suggested by ````@estebank```` in https://github.com/rust-lang/rust/issues/116180#issuecomment-3109468922. But maybe I missed something? So in the end, I realized that there is method called every time (except one, described below) a macro error is actually emitted: `ExtCtxt::trace_macros_diag`. Considering I updated what it did, I renamed it into `macro_error_and_trace_macros_diag` to better reflect it. There is only one call of `trace_macros_diag` which isn't reporting an error but just used for `macro_trace` feature, so I kept it as is. r? ````@oli-obk````
2025-07-26Rollup merge of #144383 - ZuseZ4:disable-f128-on-amdgcn, r=oli-obkJacob Pratt-0/+2
disable cfg.has_reliable_f128 on amdgcn I was experimenting with compiling a few kernels for amd while working on std::offload. It seems like the logic in https://github.com/rust-lang/compiler-builtins/pull/737 got removed, so I re-introduce it here. Probably should have a test to avoid another regression and make sure that f128 doesn't show up as target feature for amdgcn. It looks like currently we neither check that for nvptx, nor amdgpu. Maybe I could add two revisions to https://github.com/rust-lang/rust/blob/master/tests/ui/float/target-has-reliable-nightly-float.rs? r? ````@Flakebi```` fixes: https://github.com/rust-lang/rust/issues/144381
2025-07-26Rollup merge of #144379 - folkertdev:c-variadic-same-program-multiple-abis, ↵Jacob Pratt-0/+112
r=RalfJung test using multiple c-variadic ABIs in the same program tracking issue: https://github.com/rust-lang/rust/issues/100189 Check that multiple c-variadic calling conventions can be used in the same program. Clang and gcc reject defining functions with a non-default calling convention and a variable argument list, so C programs that use multiple c-variadic calling conventions are unlikely to come up. Here we validate that our codegen backends do in fact generate correct code. (CI will not run this test because it runs on aarch64, I would like to at least test that this runs on windows) try-job: `x86_64-gnu` try-job: `x86_64-msvc-*` try-job: `x86_64-apple-2`
2025-07-26Rollup merge of #144359 - RalfJung:vararg-codegen, r=compiler-errorsJacob Pratt-59/+110
add codegen test for variadics This is a part of https://github.com/rust-lang/rust/pull/144066 that can land without FCP.
2025-07-26Rollup merge of #141840 - ChrisDenton:noempty, r=ChrisDentonJacob Pratt-2/+5
If `HOME` is empty, use the fallback instead This is a minor change in the `home_dir` api. An empty path is never (or should never be) valid so if the `HOME` environment variable is empty then let's use the fallback instead. r? libs-api
2025-07-26Auto merge of #143860 - scottmcm:transmute-always-rvalue, r=WaffleLapkinbors-106/+258
Let `codegen_transmute_operand` just handle everything When combined with rust-lang/rust#143720, this means `rvalue_creates_operand` can just return `true` for *every* `Rvalue`. (A future PR could consider removing it, though just letting it optimize out is fine for now.) It's nicer anyway, IMHO, because it avoids needing the layout checks to be consistent in the two places, and thus is an overall reduction in code. Plus it's a more helpful building block when used in other places this way. (TBH, it probably would have been better to have it this way the whole time, but I clearly didn't understand `rvalue_creates_operand` when I originally wrote rust-lang/rust#109843.)
2025-07-26Do not check Sync during type_of.Camille GILLOT-264/+26
2025-07-26Fix toolingJonathan Brouwer-34/+21
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-26Remove now un-used codeJonathan Brouwer-167/+0
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-26Update test resultsJonathan Brouwer-151/+263
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-26Use the new attributes throughout the codebaseJonathan Brouwer-35/+60
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-26Parsers for the attributesJonathan Brouwer-0/+147
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-26Implement check_attrJonathan Brouwer-10/+17
2025-07-26Add attributes to AttributeKindJonathan Brouwer-0/+16