about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-29Rollup merge of #141477 - tshepang:patch-1, r=ChrisDentonJacob Pratt-5/+20
Path::with_extension: show that it adds an extension where one did no… …t exist I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions. Also, this replaced example already has a similar example below.
2025-05-29Rollup merge of #141104 - PaulDance:fix-win7-test_eq_windows_file_type, ↵Jacob Pratt-1/+23
r=ChrisDenton Test(fs): Fix `test_eq_windows_file_type` for Windows 7 Would otherwise fail on: ``` thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20: called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." } ``` This came from the read-only attribute set on the test file. In order to fix this, instead of simply disabling the test, the attribute is reset before the test's end so it may still run successfully. `@rustbot` label T-libs A-filesystem A-testsuite O-windows-7 O-windows-msvc
2025-05-29Rollup merge of #138139 - xizheyin:issue-137384, r=ChrisDentonJacob Pratt-0/+38
Emit warning while outputs is not exe and prints linkage info cc #137384 ```bash $ rustc +stage1 /dev/null --print native-static-libs --crate-type staticlib --emit metadata warning: skipping link step due to conflict: cannot output linkage information without emitting executable note: consider emitting executable to print link information warning: 1 warning emitted ```
2025-05-29Rollup merge of #136429 - fmease:gci-fix-def-site-checks, r=BoxyUwUJacob Pratt-38/+64
GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants * 1st commit: Partially addresses [#136204](https://github.com/rust-lang/rust/issues/136204) by turning const eval errors from post to pre-mono for free lifetime-generic constants. * As the linked issue/comment states, on master there's a difference between `const _: () = panic!();` (pre-mono error) and `const _<'a>: () = panic!();` (post-mono error) which feels wrong. * With this PR, both become pre-mono ones! * 2nd commit: Oof, yeah, I missed that in the initial impl! This doesn't fully address #136204 because I still haven't figured out how & where to properly & best suppress const eval of free constants whose predicates don't hold at the def site. The motivating example is `const _UNUSED: () = () where for<'_delay> String: Copy;` which can also be found over at the tracking issue #113521. r? compiler-errors or reassign
2025-05-28Auto merge of #141693 - lnicola:sync-from-ra, r=lnicolabors-956/+1513
Subtree update of `rust-analyzer` r? `@ghost`
2025-05-28Auto merge of #141696 - tgross35:rollup-fhpj180, r=tgross35bors-575/+907
Rollup of 7 pull requests Successful merges: - rust-lang/rust#140369 (Add data_ptr method to Mutex and RwLock) - rust-lang/rust#140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`) - rust-lang/rust#141404 (Improve intrinsic handling in cg_ssa) - rust-lang/rust#141411 (rustdoc: linking to a local proc macro no longer warns) - rust-lang/rust#141548 (consider glob imports in cfg suggestion) - rust-lang/rust#141627 (Drop-build cleanups) - rust-lang/rust#141670 (Fix ICE in tokenstream with contracts from parser recovery) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-28Rollup merge of #141670 - chenyukang:yukang-fix-ice-from-contracts, ↵Trevor Gross-26/+60
r=nnethercote Fix ICE in tokenstream with contracts from parser recovery Fixes rust-lang/rust#140683 After two times of parsing error, the `recover_stmt_` constructs an error ast, then when we expand macors, the invalid tokenstream triggered ICE because of mismatched delims. Expected `{` and get other tokens is an obvious error message, too much effort on recovery may introduce noise. r? ```@nnethercote```
2025-05-28Rollup merge of #141627 - nnethercote:drop-cleanups, r=matthewjasperTrevor Gross-53/+59
Drop-build cleanups Some cleanups I made while trying to speed up the program in rust-lang/rust#134404. r? ```@matthewjasper```
2025-05-28Rollup merge of #141548 - bvanjoi:issue-141256, r=petrochenkovTrevor Gross-5/+200
consider glob imports in cfg suggestion Fixes rust-lang/rust#141256 r? ```@petrochenkov```
2025-05-28Rollup merge of #141411 - lolbinarycat:rustdoc-link-proc-macro-91274, ↵Trevor Gross-8/+84
r=GuillaumeGomez rustdoc: linking to a local proc macro no longer warns fixes https://github.com/rust-lang/rust/issues/91274 tried to keep the fix general in case we ever have any other kind of item that occupies multiple namespaces simultaniously.
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 #141576 - marcoieni:pr-free-runners-aarch, r=Kobzolbors-7/+79
ci: move tests from x86_64-gnu-llvm-19 job to aarch64
2025-05-28GCI: Check where-clauses for well-formedness at the def siteLeón Orell Valerian Liehr-8/+55
2025-05-28Test(fs): Fix test_eq_windows_file_type for Windows 7Paul Mabileau-1/+23
Would otherwise fail on: ``` thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20: called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." } ``` This came from the read-only attribute set on the test file. In order to fix this, instead of simply disabling the test, the attribute is reset before the test's end so it may still run successfully. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
2025-05-28Merge pull request #19881 from Veykril/push-wsrmttkymypsLukas Wirth-171/+336
feat: Desugar assist for `let pat = expr?;` -> `let else`
2025-05-28feat: Desugar assist for `let pat = expr?;` -> `let else`Lukas Wirth-171/+336
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-28Merge pull request #19880 from Veykril/push-xmpxumsrkymkLukas Wirth-31/+97
fix: Handle included files better in IDE layer
2025-05-28Merge pull request #19872 from ChayimFriedman2/async-fn-outputLukas Wirth-11/+81
fix: Fix inference of `AsyncFnX` return type
2025-05-28fix: Handle included files better in IDE layerLukas Wirth-31/+97
This does not fully fix things, but it introduces a function that can be used to fix occurences. When using `to_def` functionality, the input node needs to come from the macro expanded include, not the real file that was included. This does unfortunately add more caller burden, but there is not really a way around it.
2025-05-28Merge pull request #19876 from ShoyuVanilla/layout-paddingLukas Wirth-23/+272
feat: Render padding information when hovering on structs
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-28Merge pull request #19879 from Veykril/push-mqykxnqtktuwLukas Wirth-84/+65
fix: Fix IDE layer not resolving some macro calls
2025-05-28feat: Render padding information when hovering on structsShoyu Vanilla-23/+272
2025-05-28Back out "Fix IDE resolution of item macros"Lukas Wirth-14/+0
This backs out commit 3e0ab7219a5464999652beca22698cd46e1e48e8.
2025-05-28Drop unnecessay codeLukas Wirth-35/+3
2025-05-28fix: Fix IDE layer not resolving some macro callsLukas Wirth-35/+62
2025-05-28Merge pull request #19877 from tgross35/remove-concat-identsLukas Wirth-44/+0
chore: Remove support for `concat_idents!`
2025-05-28chore: Remove support for `concat_idents!`Trevor Gross-44/+0
`concat_idents!` was deprecated in [1] and will be removed in the near future. rust-analyzer's support is independent of rustc's, so drop RA support now to make syncing easier. [1]: https://github.com/rust-lang/rust/pull/137653
2025-05-28Fix ICE in tokenstream with contracts from parser recoveryyukang-26/+60
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-27Merge pull request #19875 from ShoyuVanilla/issue-19844Chayim Refael Friedman-0/+17
fix: Skip pattern analysis on type mismatches
2025-05-28fix: Skip pattern analysis on type mismatchesShoyu Vanilla-0/+17
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