about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-21Rollup merge of #141296 - ↵Matthias Krüger-11/+20
azhogin:azhogin/async-drop-broken-mir-place-deref-fix, r=oli-obk Async drop fix for 'broken mir, place has deref as later projection' fixes #140975 Problem in codegen fixed with an additional temporary local.
2025-05-21Rollup merge of #141280 - Kobzol:docker-rust-lang-cache, r=marcoieniMatthias Krüger-3/+2
Use Docker cache from the current repository This is needed to make the cache work after moving CI from the `rust-lang-ci` org to `rust-lang`. Shouldn't be merged until we actually move bors. Context: https://github.com/rust-lang/infra-team/issues/188 r? `@marcoieni`
2025-05-21Rollup merge of #141267 - dianne:fix-141265, r=oli-obkMatthias Krüger-1/+63
only resolve top-level guard patterns' guards once We resolve guard patterns' guards in `resolve_pattern_inner`, so to avoid resolving them multiple times, we must avoid doing so earlier. To accomplish this, `LateResolutionVisitor::visit_pat` contains a case for guard patterns that avoids visiting their guards while walking patterns. This PR fixes #141265, which was due to `visit::walk_pat` being used instead; this meant guards at the top level of a pattern would be visited twice. e.g. it would ICE on `for x if x in [] {}`, but not `for (x if x) in [] {}`. `visit_pat` was already used for the guard pattern in the second example, on account of the top-level pattern being parens.
2025-05-21Async drop fix for 'broken mir in AsyncDropGlue, place has deref as a later ↵Andrew Zhogin-11/+20
projection' (#140975)
2025-05-21Auto merge of #141331 - matthiaskrgr:rollup-k0loxj6, r=matthiaskrgrbors-201/+277
Rollup of 7 pull requests Successful merges: - #137759 (Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child process) - #140994 (replace `cc_detect::cc2ar` with `cc::try_get_archiver`) - #141213 (Suggest use "{}", self.x instead of {self.x} when resolve x as field of `self`) - #141283 (Allow `x perf` to find rustc.exe on Windows) - #141284 (Allow trailing comma after argument in query definition) - #141317 (typeck: catch `continue`s pointing to blocks) - #141318 (Avoid creating an empty identifer in `Symbol::to_ident_string`.) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-21Rollup merge of #141318 - nnethercote:fix-140884, r=compiler-errorsMatthias Krüger-7/+20
Avoid creating an empty identifer in `Symbol::to_ident_string`. Because that causes an assertion failure in debug builds. Fixes #140884. r? `@oli-obk`
2025-05-21Rollup merge of #141317 - dianne:continue-liveness-ice-fix, r=compiler-errorsMatthias Krüger-29/+113
typeck: catch `continue`s pointing to blocks This taints the typeck results with errors if a `continue` is found not pointing to a loop. A few things were going wrong here. First, since this wasn't caught in typeck, we'd end up building the THIR and then running liveness lints on ill-formed HIR. Since liveness assumes all `continue`s point to loops, it wasn't setting a live node for the `continue`'s destination. There was a fallback for if it couldn't retrieve that live node, but it was faulty; it would create a new live node to represent an erroneous state after the analysis's RWU table had already been built. This would ICE if the new live node was used in operations, such as merging results from the arms of a match. I've removed this error-recovery since it was buggy, and we should really catch bad labels before liveness. I've also replaced an outdated comment about when liveness lints are run. At this point, I think the call to `check_liveness` could be moved elsewhere, but if it can be run when the typeck results are tainted by errors, it'll need some slight refactoring so it can bail out in that case. In lieu of that, I've added an assert. Fixes #113379 Fixes #121623
2025-05-21Rollup merge of #141284 - compiler-errors:query-nit, r=oli-obkMatthias Krüger-0/+1
Allow trailing comma after argument in query definition Don't catastrophically fail the query macro if you put a comma after your query key! r? oli-obk
2025-05-21Rollup merge of #141283 - Sol-Ell:fix-benchmarking-on-windows, r=KobzolMatthias Krüger-1/+5
Allow `x perf` to find rustc.exe on Windows Related issue: #141281
2025-05-21Rollup merge of #141213 - xizheyin:issue-141136, r=nnethercoteMatthias Krüger-16/+83
Suggest use "{}", self.x instead of {self.x} when resolve x as field of `self` Fixes #141136 Changes can be seen in the second commit: https://github.com/rust-lang/rust/commit/9de7fff0d8ab72fb57dea6255fc10fe35219db72 r? compiler
2025-05-21Rollup merge of #140994 - onur-ozkan:cc2ar-removal, r=albertlarsan68Matthias Krüger-148/+8
replace `cc_detect::cc2ar` with `cc::try_get_archiver` ~~Awaiting new release of [cc](https://crates.io/crates/cc) version with https://github.com/rust-lang/cc-rs/pull/1456 to bump the version.~~ ~~Blocked by https://github.com/rust-lang/cc-rs/pull/1456.~~ Kind a self-explanatory. try-job: dist-android
2025-05-21Rollup merge of #137759 - joshtriplett:command-chroot, r=AmanieuMatthias Krüger-0/+47
Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child process This adds a `chroot` method to the `CommandExt` extension trait for the `Command` builder, to set a directory to chroot into. This will chroot the child process into that directory right before calling chdir for the `Command`'s working directory. To avoid allowing a process to have a working directory outside of the chroot, if the `Command` does not yet have a working directory set, `chroot` will set its working directory to "/". --- ACP: https://github.com/rust-lang/libs-team/issues/551 This PR currently has the tracking issue set to "none"; if the ACP is approved, I'll file a tracking issue and update the PR.
2025-05-21Avoid creating an empty identifer in `Symbol::to_ident_string`.Nicholas Nethercote-7/+20
Because that causes an assertion failure in debug builds. Fixes #140884.
2025-05-21Downgrade the confident of suggestion `available field in format string` and ↵xizheyin-10/+4
optimize expression Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-21Allow x perf to find rustc.exe on WindowsEll-1/+5
2025-05-21Auto merge of #141320 - matthiaskrgr:rollup-ag3vf3a, r=matthiaskrgrbors-82/+507
Rollup of 6 pull requests Successful merges: - #140981 (Add match guard let chain drop order and scoping tests) - #141042 (ci: split powerpc64le-linux job) - #141078 (ci: split dist-arm-linux job) - #141222 (Implement `ptr::try_cast_aligned` and `NonNull::try_cast_aligned`.) - #141308 (Do not call name() on rpitit assoc_item) - #141316 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-21Rollup merge of #141316 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-lang/edition-guide 1 commits in 1b1bb49babd65c732468cfa515b0c009bd1d26bc..aa6ce337c0adf7a63e33960d184270f2a45ab9ef 2025-05-20 23:47:34 UTC to 2025-05-20 23:47:34 UTC - Update references to the `missing_fragment_specifier` lint (rust-lang/edition-guide#376) ## rust-lang/reference 3 commits in acd0231ebc74849f6a8907b5e646ce86721aad76..118fd1f1f0854f50e3ae1fe4b64862aad23009ca 2025-05-20 22:52:38 UTC to 2025-05-20 21:45:13 UTC - Explain why nested receivers are dyn-incompatible (rust-lang/reference#1822) - Enable `[canonicalize-issue-links]` and `[no-mentions]` in triagebot (rust-lang/reference#1788) - Mention the temporary scope of `while let`. (rust-lang/reference#1779)
2025-05-21Rollup merge of #141308 - spastorino:fix-rpitit-error-reporting-ice, ↵Matthias Krüger-11/+35
r=nnethercote Do not call name() on rpitit assoc_item Fixes #141143 r? `@nnethercote`
2025-05-21Rollup merge of #141222 - mathisbot:ptr_trycastaligned, r=tgross35Matthias Krüger-0/+85
Implement `ptr::try_cast_aligned` and `NonNull::try_cast_aligned`. Implement three common methods on raw pointers and `NonNull`s: `try_cast_aligned`. ## Related links - Tracking Issue: https://github.com/rust-lang/rust/issues/141221 ## About `#[inline]` Since the result of a call to `align_of` is a power of two known at compile time, the compiler is able to reduce a call to `try_cast_aligned` to only test and sete (or test and jne if followed by `unwrap`), at least on every tier 1 target's arch. This seemed like a good reason to `#[inline]` the function. - https://godbolt.org/z/ocehvPWMx (raw inlining) - https://godbolt.org/z/3qa4j4Yrn (comparison with no inlining)
2025-05-21Rollup merge of #141078 - marcoieni:split-dist-arm-linux, r=KobzolMatthias Krüger-10/+55
ci: split dist-arm-linux job try-job: `dist-arm-linux-*`
2025-05-21Rollup merge of #141042 - marcoieni:split-dist-powerpc64le-linux, r=KobzolMatthias Krüger-13/+63
ci: split powerpc64le-linux job try-job: `dist-powerpc64le-linux-*`
2025-05-21Rollup merge of #140981 - est31:guard_let_chains_tests, r=petrochenkovMatthias Krüger-48/+269
Add match guard let chain drop order and scoping tests We have a bunch of tests for if let chain drop order, but those tests don't cover match guard chains to the same depth. This PR adds the following tests: * match guard equivalents of the if let chains tests in the `drop-order-comparisons.rs` test, added by #133605. * match guard equivalent of the `mir_let_chains_drop_order.rs` test, added by #107251 * match guard equivalent of `temporary-early-drop.rs`, added by #133093 The added tests all have variants for 2021 and 2024, showing that the behavior on both editions matches that of if let chains on 2024. tracking issue: https://github.com/rust-lang/rust/issues/51114
2025-05-21Apply suggestions from code reviewJosh Triplett-5/+5
Link `Command::current_dir`. Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2025-05-21add missing PATHonur-ozkan-0/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-21Auto merge of #127721 - bvanjoi:issue-124273, r=petrochenkovbors-32/+357
collect doc alias as tips during resolution Close #124273 Collect the symbol in the doc alias attributes and provide a tip when a match is found. r? `@estebank`
2025-05-20typeck: catch `continue`s pointing to blocksdianne-29/+113
This taints the typeck results with errors if a `continue` is found not pointing to a loop, which fixes an ICE. A few things were going wrong here. First, since this wasn't caught in typeck, we'd end up building the THIR and then running liveness lints on ill-formed HIR. Since liveness assumes all `continue`s point to loops, it wasn't setting a live node for the `continue`'s destination. However, the fallback for this was faulty; it would create a new live node to represent the erroneous state after the analysis's RWU table had already been built. This would ICE if the new live node was used in operations, such as merging results from the arms of a match. I've removed this error-recovery since it was buggy, and we should really catch bad labels before liveness. I've also replaced an outdated comment about when liveness lints are run. At this point, I think the call to `check_liveness` could be moved elsewhere, but if it can be run when the typeck results are tainted by errors, it'll need some slight refactoring so it can bail out in that case. In lieu of that, I've added an assertion.
2025-05-21Update booksrustbot-0/+0
2025-05-20Auto merge of #141305 - matthiaskrgr:rollup-l6nwaht, r=matthiaskrgrbors-995/+1064
Rollup of 7 pull requests Successful merges: - #140972 (Add TRACING_ENABLED to Machine and add enter_trace_span!()) - #141282 (`core_float_math`: Move functions to `math` module) - #141288 (Get rid of unnecessary `BufDisplay` abstraction) - #141289 (use `Self` alias in self types rather than manually substituting it) - #141291 (link tracking issue in explicit-extern-abis.md) - #141294 (triagebot: ping me if rustdoc js is modified) - #141303 (Fix pagetoc inactive color in rustc book) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-20Implement `ptr::try_cast_aligned` and `NonNull::try_cast_aligned`.Mathis Bottinelli-0/+85
2025-05-20Do not call name() on rpitit assoc_itemSantiago Pastorino-11/+35
2025-05-20Auto merge of #140757 - dpaoliello:llvm20, r=Kobzolbors-2/+2
[win][ci] Update LLVM toolchain used to build LLVM to 20 While trying to get the aarch64-msvc build working correctly (#140136), I needed to update the version of LLVM used to build LLVM in Windows CI runners to 20 (as this has improved support for Arm64 and Arm64EC on Windows). This catches Windows up to Linux which was updated to 20 by #137189 try-job: `x86_64-apple-*` try-job: `aarch64-apple` try-job: `x86_64-msvc-*` try-job: `i686-msvc-*` try-job: `x86_64-mingw-*`
2025-05-20Rollup merge of #141303 - Urgau:pagetoc-fix-color, r=ehussMatthias Krüger-1/+1
Fix pagetoc inactive color in rustc book This PR fixes the color of inactive entry in rustc pagetoc, particularly with the "Rust" theme. | Before | After | |--------|-------| | ![image](https://github.com/user-attachments/assets/c6c8fe9a-0016-46cb-a638-71a62787b629) | ![image](https://github.com/user-attachments/assets/7146be5b-6ac3-4c9b-8e5a-eedd6ce61314) | Live preview at: http://urgau.rf.gd/book Related to https://github.com/rust-lang/rust/pull/140113#issuecomment-2888615781 r? `@ehuss`
2025-05-20Rollup merge of #141294 - lolbinarycat:triagebot-js-ping, r=aDotInTheVoidMatthias Krüger-0/+1
triagebot: ping me if rustdoc js is modified r? `@aDotInTheVoid`
2025-05-20Rollup merge of #141291 - ComputerDruid:patch-1, r=workingjubileeMatthias Krüger-1/+3
link tracking issue in explicit-extern-abis.md
2025-05-20Rollup merge of #141289 - compiler-errors:more-self, r=jhprattMatthias Krüger-5/+5
use `Self` alias in self types rather than manually substituting it Of the rougly 145 uses of `self: Ty` in the standard library, 5 of them don't use `Self` but instead choose to manually "substitute" the `impl`'s self type into the type. This leads to weird behavior sometimes (https://github.com/rust-lang/rust/issues/140611#issuecomment-2883761300) -- **to be clear**, none of these usages actually trigger any bugs, but it's possible that they may break in the future (or at least lead to lints), so let's just "fix" them proactively.
2025-05-20Rollup merge of #141288 - yotamofek:pr/rustdoc/nuke-bufdisplay, r=GuillaumeGomezMatthias Krüger-55/+39
Get rid of unnecessary `BufDisplay` abstraction r? `@GuillaumeGomez` , since you reviewed the introduction of `BufDisplay` in #136784 . Not sure when it became unnecessary, but it did :) (feel free to reassign if you wish)
2025-05-20Rollup merge of #141282 - DJMcNab:core-float-math-math, r=tgross35Matthias Krüger-933/+990
`core_float_math`: Move functions to `math` module When these functions were added in https://github.com/rust-lang/rust/pull/138087 It made a relatively common pattern for emulating these functions using an extension trait (which internally uses `libm`) much more fragile. If `core::f32` happened to be imported by the user (to access a constant, say), then that import in the module namespace would take precedence over the `f32` in the type namespace for resolving these functions, running headfirst into the stability attribute. We ran into this in [Color](https://github.com/linebender/color) and chose to release the remedial 0.3.1 and 0.2.4, to allow downstream crates to build on `docs.rs`. As these methods are perma-unstable, moving them into a new module should not have any long-term concerns, and ensures that this "breakage" doesn't adversely impact anyone else. I believe that I've made the module unstable correctly. I presume that this does not require a test to make sure stable code can't depend on the module existing? I've left the stability attribute on each function - happy to tweak this if a different pattern is more correct. Tracking issue for `core_float_math`: https://github.com/rust-lang/rust/issues/137578. This PR is as requested in https://github.com/rust-lang/rust/pull/138087. r? `@tgross35` Recommended reviewing with whitespace hidden. (This is my first PR to `std/core`/this repository, as far as I can remember)
2025-05-20Rollup merge of #140972 - Stypox:machine-tracing-flag, r=RalfJungMatthias Krüger-0/+25
Add TRACING_ENABLED to Machine and add enter_trace_span!() This PR adds the necessary infrastructure to make it possible to do tracing calls from within `rustc_const_eval` when running Miri, while making sure they don't impact the performance of normal compiler execution. This is done by adding a `const` boolean to `Machine`, false by default, but that will be set to true in Miri only. The tracing macro `enter_trace_span!()` checks if it is true before doing anything, and since the value of a `const` is known at compile time, if it it false it the whole tracing call should be optimized out. I will soon open further PRs to add tracing macro calls similar to this one, so that afterwards it will be possible to learn more about Miri's time spent in the various interpretation steps: ```rs let _guard = enter_trace_span!(M, "eval_statement", "{:?}", stmt); ``` r? `@RalfJung`
2025-05-20Fix pagetoc inactive color in rustc bookUrgau-1/+1
2025-05-21collect doc alias as tips during resolutionbohan-32/+357
2025-05-20`CommandExt::chroot`: Add tracking issueJosh Triplett-1/+1
2025-05-20`CommandExt::chroot`: Document difference to underlying `chroot`Josh Triplett-3/+5
2025-05-20Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child ↵Josh Triplett-0/+45
process This adds a `chroot` method to the `CommandExt` extension trait for the `Command` builder, to set a directory to chroot into. This will chroot the child process into that directory right before calling chdir for the `Command`'s working directory. To avoid allowing a process to have a working directory outside of the chroot, if the `Command` does not yet have a working directory set, `chroot` will set its working directory to "/".
2025-05-20Auto merge of #141292 - matthiaskrgr:rollup-9nhhk7k, r=matthiaskrgrbors-303/+279
Rollup of 7 pull requests Successful merges: - #139419 (Error on recursive opaque ty in HIR typeck) - #141236 (Resolved issue with mismatched types triggering ICE in certain scenarios) - #141253 (Warning added when dependency crate has async drop types, and the feature is disabled) - #141269 (rustc-dev-guide subtree update) - #141275 (`gather_locals`: only visit guard pattern guards when checking the guard) - #141279 (`lower_to_hir` cleanups) - #141285 (Add tick to `RePlaceholder` debug output) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-20`core_float_math`: Move functions to `math` folderDaniel McNab-933/+990
When these functions were added in https://github.com/rust-lang/rust/pull/138087 It made a relatively common pattern for emulating these functions using an extension trait (which internally uses `libm`) much more fragile. If `core::f32` happened to be imported by the user (to access a constant, say), then that import in the module namespace would take precedence over `f32` in the type namespace for resolving these functions, running headfirst into the stability attribute. We ran into this in Color - https://github.com/linebender/color - and chose to release the remedial 0.3.1 and 0.2.4, to allow downstream crates to build on `docs.rs`. As these methods are perma-unstable, moving them into a new module should not have any long-term concerns, and ensures that this breakage doesn't adversely impact anyone else.
2025-05-20Add enter_trace_span!() that checks if tracing is enabledStypox-0/+19
2025-05-20triagebot: ping me if rustdoc js is modifiedbinarycat-0/+1
2025-05-20Rollup merge of #141285 - compiler-errors:tick, r=lcnrMatthias Krüger-1/+1
Add tick to `RePlaceholder` debug output Present when debug printing canonical queries r? lcnr
2025-05-20Rollup merge of #141279 - nnethercote:lower_to_hir, r=compiler-errorsMatthias Krüger-38/+26
`lower_to_hir` cleanups Some minor cleanups I made when reading this code. r? `@Nadrieril`
2025-05-20Rollup merge of #141275 - dianne:gather-guard-pat-locals-once, r=compiler-errorsMatthias Krüger-1/+21
`gather_locals`: only visit guard pattern guards when checking the guard When checking a pattern with guards in it, `GatherLocalsVisitor` will visit both the pattern (when type-checking the let, arm, or param containing it) and local declarations in the guard expression (when checking the guard itself). This keeps it from visiting the guard when visiting the pattern, since otherwise it would gather locals from the guard twice, which would lead to a delayed bug: "evaluated expression more than once". Tracking issue for guard patterns: #129967