about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-31Rollup merge of #144721 - a4lg:riscv-hwprobe-linux-6.16, r=AmanieuSamuel Tardieu-4/+10
`std_detect`: Linux 6.16 support for RISC-V It adds feature detection of 1 extension (new in `std_detect`). New RISC-V Extension: 1. "Zabha"
2025-07-31Rollup merge of #144297 - GuillaumeGomez:ERROR_EXIT_CODE, r=AmanieuSamuel Tardieu-3/+4
Make `libtest::ERROR_EXIT_CODE` const public to not redefine it in rustdoc I think it's better to make this constant public so it can be used by crates using `libtest` as dependency. As a side-note, I will update https://github.com/rust-lang/rust/pull/143900 to make use of this constant once this is current PR is merged.
2025-07-31Rollup merge of #144053 - Kobzol:ci-remove-install-rust, r=marcoieniSamuel Tardieu-18/+0
Remove install Rust script from CI Windows ARM images should contain Rust now (https://github.com/actions/partner-runner-images/issues/77#issuecomment-3082613685). CC dpaoliello try-job: `*aarch64-msvc*`
2025-07-31Rollup merge of #136840 - Flakebi:linker-plugin-lto-fat, r=dianqkSamuel Tardieu-25/+189
Fix linker-plugin-lto only doing thin lto When rust provides LLVM bitcode files to lld and the bitcode contains function summaries as used for thin lto, lld defaults to using thin lto. This prevents some optimizations that are only applied for fat lto. We solve this by not creating function summaries when fat lto is enabled. The bitcode for the module is just directly written out. An alternative solution would be to set the `ThinLTO=0` module flag to signal lld to do fat lto. The code in clang that sets this flag is here: https://github.com/llvm/llvm-project/blob/560149b5e3c891c64899e9912e29467a69dc3a4c/clang/lib/CodeGen/BackendUtil.cpp#L1150 The code in LLVM that queries the flag and defaults to thin lto if not set is here: https://github.com/llvm/llvm-project/blob/e258bca9505f35e0a22cb213a305eea9b76d11ea/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp#L4441-L4446 try-job: x86_64-gnu-debug try-job: aarch64-gnu-debug
2025-07-31Overhaul `Constraint`.Nicholas Nethercote-241/+227
This commit changes it to store a `Region` instead of a `RegionVid` for the `Var` cases: - We avoid having to call `Region::new_var` to re-create `Region`s from `RegionVid`s in a few places, avoiding the interning process, giving a small perf win. (At the cost of the type allowing some invalid combinations of values.) - All the cases now store two `Region`s, so the commit also separates the `ConstraintKind` (a new type) from the `sub` and `sup` arguments in `Constraint`.
2025-07-31Avoid vacuous `Constraint::{VarSubVar,RegSubReg}` constraints.Nicholas Nethercote-2/+6
If the two regions are the same, we can skip it. This is a small perf win.
2025-07-31Tidy up `Cargo.toml` files.Nicholas Nethercote-14/+44
- Add some missing `tidy-alphabetical-*` markers. - Remove some unnecessary blank lines.
2025-07-31Deduplicate `IntTy`/`UintTy`/`FloatTy`.Nicholas Nethercote-13/+42
There are identical definitions in `rustc_type_ir` and `rustc_ast`. This commit removes them and places a single definition in `rustc_ast_ir`. This requires adding `rust_span` as a dependency of `rustc_ast_ir`, but means a bunch of silly conversion functions can be removed. The one annoying wrinkle is that the old version had differences in their `Debug` impls, e.g. one printed `u32` while the other printed `U32`. Some compiler error messages rely on the former (yuk), and some clippy output depends on the latter. So the commit also changes clippy to not rely on `Debug` and just implement what it needs itself.
2025-07-31Deduplicate `IntTy`/`UintTy`/`FloatTy`.Nicholas Nethercote-390/+269
There are identical definitions in `rustc_type_ir` and `rustc_ast`. This commit removes them and places a single definition in `rustc_ast_ir`. This requires adding `rust_span` as a dependency of `rustc_ast_ir`, but means a bunch of silly conversion functions can be removed. The one annoying wrinkle is that the old version had differences in their `Debug` impls, e.g. one printed `u32` while the other printed `U32`. Some compiler error messages rely on the former (yuk), and some clippy output depends on the latter. So the commit also changes clippy to not rely on `Debug` and just implement what it needs itself.
2025-07-31Check consts in `ValidateBoundVars`.Nicholas Nethercote-4/+23
Alongside the existing type and region checking.
2025-07-31Merge pull request #20349 from Veykril/push-orvqsnqtttzvLukas Wirth-3331/+3073
`cargo clippy --fix`
2025-07-31Make const bound handling more like types/regions.Nicholas Nethercote-69/+82
Currently there is `Ty` and `BoundTy`, and `Region` and `BoundRegion`, and `Const` and... `BoundVar`. An annoying inconsistency. This commit repurposes the existing `BoundConst`, which was barely used, so it's the partner to `Const`. Unlike `BoundTy`/`BoundRegion` it lacks a `kind` field but it's still nice to have because it makes the const code more similar to the ty/region code everywhere. The commit also removes `impl From<BoundVar> for BoundTy`, which has a single use and doesn't seem worth it. These changes fix the "FIXME: We really should have a separate `BoundConst` for consts".
2025-07-31Streamline const folding/visiting.Nicholas Nethercote-26/+20
Type folders can only modify a few "types of interest": `Binder`, `Ty`, `Predicate`, `Clauses`, `Region`, `Const`. Likewise for type visitors, but they can also visit errors (via `ErrorGuaranteed`). Currently the impls of `try_super_fold_with`, `super_fold_with`, and `super_visit_with` do more than they need to -- they fold/visit values that cannot contain any types of interest. This commit removes those unnecessary fold/visit operations, which makes these impls more similar to the impls for `Ty`. It also removes the now-unnecessary derived impls for the no-longer-visited types.
2025-07-31`cargo clippy --fix`Lukas Wirth-3331/+3073
2025-07-31Auto merge of #144723 - Zalathar:rollup-f9e0rfo, r=Zalatharbors-152/+244
Rollup of 3 pull requests Successful merges: - rust-lang/rust#144657 (fix: Only "close the window" when its the last annotated file) - rust-lang/rust#144665 (Re-block SRoA on SIMD types) - rust-lang/rust#144713 (`rustc_middle::ty` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-31Rollup merge of #144713 - nnethercote:rustc_middle-ty-cleanups, r=lcnrStuart Cook-149/+141
`rustc_middle::ty` cleanups r? `@davidtwco`
2025-07-31Rollup merge of #144665 - scottmcm:restore-sroa-simd-check, r=compiler-errorsStuart Cook-1/+55
Re-block SRoA on SIMD types Fixes rust-lang/rust#144621
2025-07-31Rollup merge of #144657 - Muscraft:fix-unicode-close-window, r=fee1-deadStuart Cook-2/+48
fix: Only "close the window" when its the last annotated file While comparing the Unicode theme output of `rustc` and `annotate-snippets`, I found that `rustc` would ["close the window"](https://github.com/rust-lang/rust/blob/686bc1c5f9c06762b18082434c04d514acf6707e/compiler/rustc_errors/src/emitter.rs#L1025-L1027) (draw a `╰╴`), even though there were other annotated files that followed the current one. This PR makes it so the emitter will only "close the window" on the last annotated file. Before: ``` error[E0624]: method `method` is private ╭▸ $DIR/close_window.rs:9:7 │ LL │ s.method(); ╰╴ ━━━━━━ private method │ ⸬ $DIR/auxiliary/close_window.rs:3:5 │ LL │ fn method(&self) {} ╰╴ ──────────────── private method defined here ``` After: ``` error[E0624]: method `method` is private ╭▸ $DIR/close_window.rs:9:7 │ LL │ s.method(); │ ━━━━━━ private method │ ⸬ $DIR/auxiliary/close_window.rs:3:5 │ LL │ fn method(&self) {} ╰╴ ──────────────── private method defined here ```
2025-07-31Fix CI build failure when using new libtest public constantGuillaume Gomez-2/+3
2025-07-31Make `libtest::ERROR_EXIT_CODE` const public to not redefine it in rustdocGuillaume Gomez-3/+3
2025-07-31Fix linker-plugin-lto only doing thin ltoFlakebi-25/+189
When rust provides LLVM bitcode files to lld and the bitcode contains function summaries as used for thin lto, lld defaults to using thin lto. This prevents some optimizations that are only applied for fat lto. We solve this by not creating function summaries when fat lto is enabled. The bitcode for the module is just directly written out. An alternative solution would be to set the `ThinLTO=0` module flag to signal lld to do fat lto. The code in clang that sets this flag is here: https://github.com/llvm/llvm-project/blob/560149b5e3c891c64899e9912e29467a69dc3a4c/clang/lib/CodeGen/BackendUtil.cpp#L1150 The code in LLVM that queries the flag and defaults to thin lto if not set is here: https://github.com/llvm/llvm-project/blob/e258bca9505f35e0a22cb213a305eea9b76d11ea/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp#L4441-L4446
2025-07-31Merge pull request #4508 from RalfJung/rustupRalf Jung-2/+6
Rustup
2025-07-31Merge pull request #20342 from Veykril/push-zysqtqskuxvrLukas Wirth-425/+848
Reorganize proc-macro-srv more, add `--format` and `--version` args
2025-07-31Add version command to proc-macro-srvLukas Wirth-18/+139
2025-07-31bless cargo miri doctest executionRalf Jung-1/+5
2025-07-31Reorganize proc-macro-srvLukas Wirth-148/+131
2025-07-31std_detect: Linux 6.16 support for RISC-VTsukasa OI-4/+10
It adds feature detection of 1 extension (new in std_detect). New RISC-V Extension: 1. "Zabha"
2025-07-31Properly clean proc-macro-srv proc-macro temp dirLukas Wirth-18/+125
2025-07-31Merge pull request #4509 from RalfJung/win-ciRalf Jung-6/+0
rely on preinstalled rustup on windows-arm
2025-07-31fix: Only "close the window" when its the last annotated fileScott Schafer-3/+6
2025-07-31rely on preinstalled rustup on windows-armRalf Jung-6/+0
2025-07-31rustupRalf Jung-1/+1
2025-07-31Extend `is_case_difference` to handle digit-letter confusablesxizheyin-1/+1
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-31Extend `is_case_difference` to handle digit-letter confusablesxizheyin-58/+290
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-31Auto merge of #144718 - Zalathar:rollup-76lrtf2, r=Zalatharbors-334/+1215
Rollup of 6 pull requests Successful merges: - rust-lang/rust#135975 (Implement `push_mut`) - rust-lang/rust#143672 (Fix Box allocator drop elaboration) - rust-lang/rust#144232 (Implement support for `become` and explicit tail call codegen for the LLVM backend) - rust-lang/rust#144663 (coverage: Re-land "Enlarge empty spans during MIR instrumentation") - rust-lang/rust#144685 (Only extract lang items once in codegen_fn_attrs) - rust-lang/rust#144717 (Move `rustc_middle::parameterized`) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-31Rollup merge of #144717 - nnethercote:mv-rustc_middle-parameterized, ↵Stuart Cook-189/+170
r=compiler-errors Move `rustc_middle::parameterized` It doesn't need to be in `rustc_middle`. r? `@compiler-errors`
2025-07-31Rollup merge of #144685 - jdonszelmann:lang-items-once, r=wafflelapkinStuart Cook-5/+3
Only extract lang items once in codegen_fn_attrs This one should be obvious. These two extraction points used to be far apart but now that they're refactored to be close it was rather obvious we're just doing double work.... r? ``@WaffleLapkin`` Buils on rust-lang/rust#144655
2025-07-31Rollup merge of #144232 - xacrimon:explicit-tail-call, r=WaffleLapkinStuart Cook-0/+21
Implement support for `become` and explicit tail call codegen for the LLVM backend This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (https://github.com/rust-lang/rust/issues/112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged. During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
2025-07-31Rollup merge of #144663 - Zalathar:empty-span, r=petrochenkovStuart Cook-73/+57
coverage: Re-land "Enlarge empty spans during MIR instrumentation" This allows us to assume that coverage spans will only be discarded during codegen in very unusual situations. --- This seemingly-simple change has a rather messy history: - rust-lang/rust#140847 - rust-lang/rust#141650 - rust-lang/rust#144298 - rust-lang/rust#144480 Since then, a number of related changes have landed that should make it reasonable to try again: - rust-lang/rust#144530 - rust-lang/rust#144560 - rust-lang/rust#144616 In particular, we have multiple fixes/mitigations, and a confirmed regression test for the original bug that is not triggered by re-landing the changes in this PR.
2025-07-31Rollup merge of #144232 - xacrimon:explicit-tail-call, r=WaffleLapkinStuart Cook-12/+191
Implement support for `become` and explicit tail call codegen for the LLVM backend This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (https://github.com/rust-lang/rust/issues/112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged. During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
2025-07-31Rollup merge of #143672 - beepster4096:box_drop_flags_again, r=oli-obkStuart Cook-26/+551
Fix Box allocator drop elaboration New version of rust-lang/rust#131146. Clearing Box's drop flag after running its destructor can cause it to skip dropping its allocator, so just don't. Its cleared by the drop ladder code afterwards already. Unlike the last PR this also handles other types with destructors properly, in the event that we can have open drops on them in the future (by partial initialization or DerefMove or something). Finally, I also added tests for the interaction with async drop here but I discovered rust-lang/rust#143658, so one of the tests has a `knownbug` annotation. Not sure if it should be in this PR at all though. Fixes rust-lang/rust#131082 r? wesleywiser - prev. reviewer
2025-07-31Rollup merge of #135975 - balt-dev:master, r=tgross35Stuart Cook-29/+243
Implement `push_mut` Implementation of rust-lang/rust#135974.
2025-07-31Fix up size asserts.Nicholas Nethercote-14/+26
- Put them in the module that defines the type. - Add some `WithCachedTypeInfo<T>` asserts for consistency.
2025-07-31Remove `TyCtxt::get_attrs_unchecked`.Nicholas Nethercote-3/+3
It's identical to `TyCtxt::get_all_attrs` except it takes `DefId` instead of `impl Into<DefIf>`.
2025-07-31Move `InferVarInfo` out of `rustc_middle`.Nicholas Nethercote-15/+16
It's only used in `rustc_hir_typeck`.
2025-07-31Remove `TyCtxt::get_attrs_unchecked`.Nicholas Nethercote-19/+8
It's identical to `TyCtxt::get_all_attrs` except it takes `DefId` instead of `impl Into<DefIf>`.
2025-07-31Remove `ParamEnvAnd::into_parts`.Nicholas Nethercote-14/+8
The fields are public, so this doesn't need a method, normal deconstruction and/or field access is good enough.
2025-07-31Move `TermVid` out of `rustc_middle`.Nicholas Nethercote-28/+26
It's only used in `rustc_infer`.
2025-07-31Move `rustc_middle::parameterized` to `rustc_metadata`.Nicholas Nethercote-176/+170
It's only used there.
2025-07-31Remove unused `ParameterizedOverTcx` impls.Nicholas Nethercote-13/+0