about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-28Rollup merge of #141404 - bjorn3:refactor_cg_ssa_call_codegen, r=davidtwcoTrevor Gross-266/+237
Improve intrinsic handling in cg_ssa * Move all intrinsic handling code to the start of `codegen_call_terminator`. * Push some intrinsic handling code into `codegen_intrinsic_call`. * Don't depend on FnAbi for intrinsics.
2025-05-28Rollup merge of #140697 - Sa4dUs:split-autodiff, r=ZuseZ4Trevor Gross-217/+234
Split `autodiff` into `autodiff_forward` and `autodiff_reverse` This PR splits `#[autodiff]` macro so `#[autodiff(df, Reverse, args)]` would become `#[autodiff_reverse(df, args)]` and `#[autodiff(df, Forward, args)]` would become `#[autodiff_forwad(df, args)]`.
2025-05-28Rollup merge of #140369 - jplatte:mutex-rwlock-data-ptr, r=AmanieuTrevor Gross-0/+33
Add data_ptr method to Mutex and RwLock Implementation of https://github.com/rust-lang/rust/issues/140368 / https://github.com/rust-lang/libs-team/issues/531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
2025-05-28Auto merge of #141501 - marcoieni:dist-x86_64-linux-codebuild-again, r=Kobzolbors-2/+2
ci: move dist-x86_64-linux job to codebuild
2025-05-28Auto merge of #141375 - kraj:kraj/aarch64-musl, r=Mark-Simulacrumbors-2/+1
Disable libunwind cross-architecture unwinding Building with _LIBUNWIND_IS_NATIVE_ONLY disables code for cross-architecture unwinding It also enables some additional code that handles PAC-specific unwind info it helps compiling with the -mbranch-protection=pac or -mbranch-protection=standard flags This fixes build with clang/musl on aarch64
2025-05-28Auto merge of #141668 - tgross35:rollup-03gg6lf, r=tgross35bors-1351/+2143
Rollup of 8 pull requests Successful merges: - rust-lang/rust#140367 (add `asm_cfg`: `#[cfg(...)]` within `asm!`) - rust-lang/rust#140894 (Make check-cfg diagnostics work in `#[doc(cfg(..))]`) - rust-lang/rust#141252 (gvn: bail out unavoidable non-ssa locals in repeat) - rust-lang/rust#141517 (rustdoc: use descriptive tooltip if doctest is conditionally ignored) - rust-lang/rust#141551 (Make two transmute-related MIR lints into HIR lint) - rust-lang/rust#141591 (ci: fix llvm test coverage) - rust-lang/rust#141647 (Bump master `stage0` compiler) - rust-lang/rust#141659 (Add `Result::map_or_default` and `Option::map_or_default`) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-27Disable libunwind cross-architecture unwindingKhem Raj-2/+1
Building with _LIBUNWIND_IS_NATIVE_ONLY disables code for cross-architecture unwinding it is disabled by default in LLVM [1], replicate the cmake behavior in bootstrap process It also enables some additional code that handles PAC-specific unwind info it helps compiling with the -mbranch-protection=pac or -mbranch-protection=standard flags This fixes build with clang/musl on aarch64 [1] https://github.com/llvm/llvm-project/commit/85624c5de3e831ffa01fdc2d159e3d69c30de08d Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-05-27Rollup merge of #141659 - tkr-sh:map-or-default, r=AmanieuTrevor Gross-0/+60
Add `Result::map_or_default` and `Option::map_or_default` Closes: https://github.com/rust-lang/rust/pull/138068 _This PR has been recreated because of the inactivity of the author (Cf. https://github.com/rust-lang/rust/pull/138068#issuecomment-2912412288)_
2025-05-27Rollup merge of #141647 - jieyouxu:bump-master-stage0, r=pietroalbiniTrevor Gross-460/+460
Bump master `stage0` compiler To include beta backport of revert rust-lang/rust#141024 which should undo linker warnings during bootstrapping of Windows MSVC targets due to rust-lang/rust#140176. Closes rust-lang/rust#141395. r? `@Mark-Simulacrum` (or release)
2025-05-27Rollup merge of #141591 - marcoieni:fix-llvm-test-coverage, r=KobzolTrevor Gross-2/+2
ci: fix llvm test coverage try-job: x86_64-gnu-llvm-19-1 try-job: x86_64-gnu-llvm-20-1
2025-05-27Rollup merge of #141551 - compiler-errors:hir-lints, r=BoxyUwUTrevor Gross-407/+488
Make two transmute-related MIR lints into HIR lint Make `PTR_TO_INTEGER_TRANSMUTE_IN_CONSTS` (rust-lang/rust#130540) and `UNNECESSARY_TRANSMUTES` (rust-lang/rust#136083) into "normal" HIR-based lints. Funny enough this came up in the review of the latter (https://github.com/rust-lang/rust/pull/136083#issuecomment-2614301413), but I guess it just was overlooked. But anywyas, there's no reason for these to be MIR lints; in fact, it makes the suggestions for them a bit more complicated than necessary. Note that there's probably a few more simplifications and improvements to be done here. Follow-ups can be done in a separate PR, especially if they're about the messaging and suggestions themselves, which I didn't write.
2025-05-27Rollup merge of #141517 - ↵Trevor Gross-21/+53
lolbinarycat:rustdoc-doctest-tooltip-ignore-141092, r=notriddle rustdoc: use descriptive tooltip if doctest is conditionally ignored fixes https://github.com/rust-lang/rust/issues/141092 here's what it looks like now: ![screenshot](https://github.com/user-attachments/assets/71e679fe-8828-439d-a2ce-b9187ad3aeea)
2025-05-27Rollup merge of #141252 - dianqk:gvn-repeat-index, r=saethlinTrevor Gross-1/+91
gvn: bail out unavoidable non-ssa locals in repeat Fixes #141251. We cannot transform `*elem` to `array[idx1]` in the following code, as `idx1` has already been modified. ```rust mir! { let array; let elem; { array = [*val; 5]; elem = &array[idx1]; idx1 = idx2; RET = *elem; Return() } } ``` Perhaps I could transform it to `array[0]`, but I prefer the conservative approach. r? mir-opt
2025-05-27Rollup merge of #140894 - Urgau:check-cfg-rustdoc, r=GuillaumeGomezTrevor Gross-28/+120
Make check-cfg diagnostics work in `#[doc(cfg(..))]` This PR makes it so that the check-cfg `unexpected_cfgs` lint, is correctly emitted in `rustdoc`'s `#[doc(cfg(..))]`. This is achieved by adding a custom trait to `cfg_matches` (the method that emits the lint) which permits `rustc` and `rustdoc` to each have their way to emitting lints (via buffered lints/AST for `rustc` and via `TyCtxt`/HIR for `rustdoc`). The reason this is required is because buffered lints operates on the AST but `rustdoc` uses the HIR and by the time `rustdoc` calls `cfg_matches` we are way passed the point where buffered lints have been drain and emitted. Best reviewed commit by commit. r? `@jieyouxu` (for the compiler part) r? `@GuillaumeGomez` (for the rustdoc part)
2025-05-27Rollup merge of #140367 - folkertdev:asm-cfg, r=nnethercoteTrevor Gross-432/+869
add `asm_cfg`: `#[cfg(...)]` within `asm!` tracking issue: https://github.com/rust-lang/rust/issues/140364 blocked on: https://github.com/rust-lang/rust/pull/140490 This feature was discussed in https://github.com/rust-lang/rust/issues/140279. It allows configuring templates and operands in the assembly macros, for example: ```rust asm!( // or global_asm! or naked_asm! "nop", #[cfg(target_feature = "sse2")] "nop", // ... #[cfg(target_feature = "sse2")] a = const 123, // only used on sse2 ); ``` r? `@tgross35` cc `@traviscross` `@Amanieu` Now builds on https://github.com/rust-lang/rust/pull/140490, which should be merged first.
2025-05-27Auto merge of #129658 - saethlin:spare-a-crumb, r=jhprattbors-212/+158
Add some track_caller info to precondition panics Currently, when you encounter a precondition check, you'll always get the caller location of the implementation of the precondition checks. But with this PR, you'll be told the location of the invalid call. Which is useful. I thought of this while looking at https://github.com/rust-lang/rust/pull/129642#issuecomment-2311703898. The changes to `tests/ui/const*` happen because the const-eval interpreter skips `#[track_caller]` frames in its backtraces. The perf implications of this are: * Increased debug binary sizes. The caller_location implementation requires that the additional data we want to display here be stored in const allocations, which are deduplicated but not across crates. There is no impact on optimized build sizes. The panic path and the caller location data get optimized out. * The compile time hit to opt-incr-patched bitmaps happens because the patch changes the line number of some function calls with precondition checks, causing us to go from 0 dirty CGUs to 1 dirty CGU. * The other compile time hits are marginal but real, and due to doing a handful of new queries. Adding more useful data isn't completely free.
2025-05-27Auto merge of #141662 - matthiaskrgr:rollup-9kt4zj7, r=matthiaskrgrbors-413/+336
Rollup of 8 pull requests Successful merges: - rust-lang/rust#141312 (Add From<TryLockError> for io::Error) - rust-lang/rust#141495 (Rename `{GenericArg,Term}::unpack()` to `kind()`) - rust-lang/rust#141602 (triagebot: label LLVM submodule changes with `A-LLVM`) - rust-lang/rust#141632 (remove `visit_mt` from `ast::mut_visit`) - rust-lang/rust#141640 (test: convert version_check ui test to run-make) - rust-lang/rust#141645 (bump fluent-* crates) - rust-lang/rust#141650 (coverage: Revert "unused local file IDs" due to empty function names) - rust-lang/rust#141654 (tests: mark option-niche-eq as fixed on LLVM 21) Failed merges: - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`) - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-27Rollup merge of #141654 - durin42:randomly-fixed-test, r=jieyouxuMatthias Krüger-15/+11
tests: mark option-niche-eq as fixed on LLVM 21 Some combination of recent Rust changes (between 3d86494a0d01 and aa57e46e24a4 from what I can tell) and changes in LLVM 21 (not recently, as best I can tell) have caused this test to start showing the behavior we want, so it's time to move this test to a proper place and mark it as fixed on LLVM 21. ~~Probably "fixes" rust-lang/rust#49892, but I'll let others make that call.~~ Closes rust-lang/rust#49892 unless we want to break out a dedicated issue for `Option<bool>::eq` on LLVM 20 (seems low-value). `@rustbot` label llvm-main
2025-05-27Rollup merge of #141650 - Zalathar:revert-unused-local-file, r=ZalatharMatthias Krüger-154/+62
coverage: Revert "unused local file IDs" due to empty function names The changes to coverage metadata generation in rust-lang/rust#140847 appear to be the most likely cause of the `function name is empty` errors reported in rust-lang/rust#141577. If that guess is correct, great. If not, no big deal. --- This reverts commit 3b22c21dd8c30f499051fe7a758ca0e5d81eb638, reversing changes made to 5f292eea6d63abbd26f1e6e00a0b8cf21d828d7d. r? ghost
2025-05-27Rollup merge of #141645 - klensy:fluent-b, r=jieyouxuMatthias Krüger-23/+15
bump fluent-* crates This bumps fluent-* crates, switching to more up-to-date deps, reducing number of old ones. changelogs is pure refactoring: https://github.com/projectfluent/fluent-rs/blob/fluent-bundle%400.16.0/fluent-bundle/CHANGELOG.md https://github.com/projectfluent/fluent-rs/blob/fluent-bundle%400.16.0/fluent-syntax/CHANGELOG.md
2025-05-27Rollup merge of #141640 - ↵Matthias Krüger-17/+13
Fabian-Gruenbichler:mr/test-version-check-rpath-false, r=jieyouxu test: convert version_check ui test to run-make else it breaks with `rpath=false`. Fixes: rust-lang/rust#141579
2025-05-27Rollup merge of #141632 - fee1-dead-contrib:push-txmttkxvwqxl, r=oli-obkMatthias Krüger-11/+3
remove `visit_mt` from `ast::mut_visit` doesn't look like anyone is using it.
2025-05-27Rollup merge of #141602 - jieyouxu:llvm-submodule, r=apirainoMatthias Krüger-0/+7
triagebot: label LLVM submodule changes with `A-LLVM` Fixes rust-lang/rust#141601. r? `@apiraino`
2025-05-27Rollup merge of #141495 - compiler-errors:rename-unpack, r=fmeaseMatthias Krüger-185/+185
Rename `{GenericArg,Term}::unpack()` to `kind()` A well-deserved rename IMO. r? `@oli-obk` or `@lcnr` (or anyone) cc `@rust-lang/types,` but I'd be surprised if this is controversial.
2025-05-27Rollup merge of #141312 - cberner:filelock_from, r=joshtriplettMatthias Krüger-8/+40
Add From<TryLockError> for io::Error Adds a `From` impl to make error propagation easier, as discussed in the tracking issue `TryLockError` is unstable under the "file_lock" feature. The related tracking issue is https://github.com/rust-lang/rust/issues/130994 This PR also cleanups the Windows implementation of `try_lock()` and `try_lock_shared()` as [discussed here](https://github.com/rust-lang/rust/pull/140718#discussion_r2076678485)
2025-05-27✨ feat: map_or_default for result and optiontk-0/+60
2025-05-27Auto merge of #141644 - compiler-errors:rollup-gl5hize, r=compiler-errorsbors-997/+1281
Rollup of 17 pull requests Successful merges: - rust-lang/rust#140591 (Fix malformed suggestion for E0061 when method is a macro token in macro context) - rust-lang/rust#141536 (Improve `ambiguous_wide_pointer_comparisons` lint compare diagnostics) - rust-lang/rust#141552 (Pull out dedicated `cfg_version` syntax test from feature gate test) - rust-lang/rust#141556 (bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2) - rust-lang/rust#141563 (Remove out-of-date `noop_*` names.) - rust-lang/rust#141568 (dist: make sure llvm-project submodule is present) - rust-lang/rust#141580 (Use more detailed spans in dyn compat errors within bodies) - rust-lang/rust#141582 (intrinsics, ScalarInt: minor cleanup) - rust-lang/rust#141584 (Support `opaque_types_defined_by` for `SyntheticCoroutineBody`) - rust-lang/rust#141587 (Add missing edition directives for async-await tests) - rust-lang/rust#141594 (Add `generic_arg_infer` test) - rust-lang/rust#141596 (rustc book: fix erratic sentence by making it more simple) - rust-lang/rust#141599 (Remove an unnecessary use of `Box::into_inner`.) - rust-lang/rust#141611 (Update mdbook to 0.4.51) - rust-lang/rust#141616 (Remove spastorino from vacations) - rust-lang/rust#141623 (use custom types to clarify arguments to `emit_ptr_va_arg`) - rust-lang/rust#141635 (further dedup `WalkItemKind` for `mut_visit` and `visit`) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-27tests: mark option-niche-eq as fixed on LLVM 21Augie Fackler-15/+11
Some combination of recent Rust changes (between 3d86494a0d01 and aa57e46e24a4 from what I can tell) and changes in LLVM 21 (not recently, as best I can tell) have caused this test to start showing the behavior we want, so it's time to move this test to a proper place and mark it as fixed on LLVM 21.
2025-05-27coverage: Revert "unused local file IDs" due to empty function namesZalathar-154/+62
This reverts commit 3b22c21dd8c30f499051fe7a758ca0e5d81eb638, reversing changes made to 5f292eea6d63abbd26f1e6e00a0b8cf21d828d7d.
2025-05-27Bump master `stage0` compilerJieyou Xu-460/+460
To include beta backport of revert <https://github.com/rust-lang/rust/pull/141024> which should undo linker warnings during bootstrapping of Windows MSVC targets due to <https://github.com/rust-lang/rust/pull/140176>.
2025-05-27Auto merge of #141641 - marcoieni:codebuild-ghcr-pr-job, r=Kobzolbors-1/+1
ci: use ghcr registry for x86_64-gnu-tools job
2025-05-27triagebot: label `src/llvm-project` and `rustc_{llvm, codegen_llvm}` changes ↵Jieyou Xu-0/+7
with `A-LLVM`
2025-05-27Fix some var namesMichael Goulet-34/+34
2025-05-27Rename unpack to kindMichael Goulet-165/+165
2025-05-27bump fluent-* cratesklensy-23/+15
2025-05-27Rollup merge of #141635 - fee1-dead-contrib:push-lmyymwotrspk, r=oli-obkMichael Goulet-284/+145
further dedup `WalkItemKind` for `mut_visit` and `visit` also some drive-by fixes. r? oli-obk
2025-05-27Rollup merge of #141623 - folkertdev:va-arg-explicit-types, r=workingjubileeMichael Goulet-22/+61
use custom types to clarify arguments to `emit_ptr_va_arg` tracking issue: https://github.com/rust-lang/rust/issues/44930 split out of https://github.com/rust-lang/rust/pull/141622 r? ``@workingjubilee`` ``@rustbot`` label: +F-c_variadic
2025-05-27Rollup merge of #141616 - spastorino:remove-spastorino-on-vacations, ↵Michael Goulet-1/+0
r=spastorino Remove spastorino from vacations
2025-05-27Rollup merge of #141611 - ehuss:update-mdbook, r=Mark-SimulacrumMichael Goulet-3/+3
Update mdbook to 0.4.51 This fixes a silly regression introduced in 0.4.50 that broke the search hotkey (https://github.com/rust-lang/rust/pull/141457). Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0451
2025-05-27Rollup merge of #141599 - nnethercote:rm-Box-into_inner, r=fmease,chenyukangMichael Goulet-2/+1
Remove an unnecessary use of `Box::into_inner`. r? ```@chenyukang```
2025-05-27Rollup merge of #141596 - tshepang:patch-2, r=UrgauMichael Goulet-2/+2
rustc book: fix erratic sentence by making it more simple
2025-05-27Rollup merge of #141594 - BoxyUwU:another_gai_test, r=jieyouxuMichael Goulet-0/+25
Add `generic_arg_infer` test I think most of our existing tests around behaviour of repeat expr inferred counts fail by not having enough inference progress, rather than by having enough inference progress but the element not actually implementing `Copy`.
2025-05-27Rollup merge of #141587 - ferrocene:lw-yurotqzwvwlw, r=jieyouxuMichael Goulet-36/+45
Add missing edition directives for async-await tests These tests specifically test 2015 edition behavior
2025-05-27Rollup merge of #141584 - compiler-errors:typing-env-synthetic-body, r=lcnrMichael Goulet-3/+18
Support `opaque_types_defined_by` for `SyntheticCoroutineBody` We create a synthetic MIR body for the `AsyncFnOnce` impl for async closures. That body goes through all passes that a regular body does, including promotion. Promotion sometimes requires computing that the type of an rvalue is `Freeze`, which requires computing the typing env of a body. This requires calling `opaque_types_defined_by` on the body's def id, which leads to an ICE today since we don't expect that query to be called for synthetic bodies. While we could fix this by, for example, computing the typeck root of the body before calling a `TypingEnv` constructor, I think it's appropriate to do a more general fix here since I think it's reasonable that other passes might do analysis too. Fixes rust-lang/rust#141466 r? ```@lcnr``` or ```@oli-obk```
2025-05-27Rollup merge of #141582 - RalfJung:cleanup, r=bjorn3Michael Goulet-28/+60
intrinsics, ScalarInt: minor cleanup Taken out of https://github.com/rust-lang/rust/pull/141507 while we resolve technical disagreements in that PR. r? ``@bjorn3``
2025-05-27Rollup merge of #141580 - oli-obk:early-dyn-catches-the-incompat, ↵Michael Goulet-206/+205
r=compiler-errors Use more detailed spans in dyn compat errors within bodies Within bodies we can employ the full dyn compat check query instead of only doing the minimal hir ty lowerer one. This in turn gives us better spans and also silences many follow-up duplicate or bogus errors. alternative to https://github.com/rust-lang/rust/pull/141439, tho I think I could turn the delayed bug from that one into a bug now instead of having an error code path. r? `@compiler-errors` cc `@fmease`
2025-05-27Rollup merge of #141568 - onur-ozkan:141393-fix, r=KobzolMichael Goulet-0/+8
dist: make sure llvm-project submodule is present Zero-config `x install` fails when bootstrap tries to copy files from the LLVM submodule because it's not properly initialized/handled. This diff handles that. Fixes https://github.com/rust-lang/rust/issues/141393
2025-05-27Rollup merge of #141563 - nnethercote:rm-noop, r=petrochenkovMichael Goulet-23/+5
Remove out-of-date `noop_*` names. `mut_visit.rs` has a single function with a `noop_` prefix: `noop_filter_map_expr`. This commit renames as `walk_filter_map_expr` which is consistent with other functions in this file. The commit also removes out-of-date comments that refer to `noop_*` methods. r? `@petrochenkov`
2025-05-27Rollup merge of #141556 - jeremyd2019:patch-1, r=jieyouxuMichael Goulet-1/+3
bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2 Cygwin defaults to rooting Windows paths in /cygdrive/X, while MSYS2 configures them to be /X. Regardless of configuration, drives are always accessible as /proc/cygdrive/X, so use that. If there are other shells on Windows that are supported and use /X style paths, perhaps something more complicated needs to be done. r? `@jieyouxu` `@Berrysoft` `@mati865`
2025-05-27Rollup merge of #141552 - jieyouxu:cfg-version-tests, r=est31Michael Goulet-243/+350
Pull out dedicated `cfg_version` syntax test from feature gate test Tracking issue: rust-lang/rust#64796. Closes rust-lang/rust#141452, as a follow-up to https://github.com/rust-lang/rust/pull/141413#discussion_r2104490809 (point 3 of that is probably too pedantic). The feature gate test was dual-purposing causing feature gate errors to distract from syntax exercises. ``@rustbot`` label +F-cfg_version r? ``@est31``