-
Notifications
You must be signed in to change notification settings - Fork 546
Rustc pull update #2437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Rustc pull update #2437
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feat: highlight unsafe operations
[win][CI] Convert paths to Windows format before adding to PATH While trying to get the `aarch64-msvc` build working correctly (#140136), I noticed that the `PATH` observed during the Rust steps of the build on Windows builds had some entries still in MinGW format, which means that Windows would not be able to use them correctly: From <https://github.com/rust-lang/rust/actions/runs/14606167901/job/40975555680#step:28:192> note the path for `ninja` and `sccache`. ``` PATH = Some(C:\a\rust\rust\src\ci\citool\../../../build/citool\debug\deps;C:\a\rust\rust\src\ci\citool\../../../build/citool\debug;C:\Users\runneradmin\.rustup\toolchains\stable-aarch64-pc-windows-msvc\lib\rustlib\aarch64-pc-windows-msvc\lib;C:\Program Files\Git\clangarm64/bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;/c/a/rust/rust/ninja;/c/a/rust/rust/sccache;C:\Users\runneradmin/.cargo/bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files (x86)\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver\;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\arm64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.442-6\x64\bin;C:\Program Files (x86)\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\clangarm64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps) ``` The fix for this is to use `cygpath` to convert from the Cygwin format back to native Windows format before adding to the `PATH`. --- try-job: dist-aarch64-msvc try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: i686-msvc-1 try-job: i686-msvc-2 try-job: x86_64-mingw-1 try-job: x86_64-mingw-2 try-job: dist-i686-mingw
minor: Sync from downstream
update llvm-tools logic for `dist` and `install` steps First commit aligns `build_steps::compile` and `build_steps::dist` logics for copying llvm-tools, and the second commit adds the correct `should_run` condition for `LlvmTools` step as the previous one was clearly incorrect. Fixes #140913
rustc-dev-guide subtree update r? `@ghost`
…iler-errors `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
`lower_to_hir` cleanups Some minor cleanups I made when reading this code. r? `@Nadrieril`
Add tick to `RePlaceholder` debug output Present when debug printing canonical queries r? lcnr
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
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`
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 (rust-lang/rust#140611 (comment)) -- **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.
…Void triagebot: ping me if rustdoc js is modified r? `@aDotInTheVoid`
[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-*`
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
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`
…rrors Match on lang item kind instead of using an if/else chain Similar to how the new solver does this. Just noticed while I was adding a new entry to the chain 😆
fix: Fix cache problems with lints level
minor: Support `transmute_unchecked` intrinsic for mir-eval
Emit a warning if the doctest `main` function will not be run Fixes #140310. I think we could try to go much further like adding a "link" (ie UI annotations) on the `main` function in the doctest. However that will require some more computation, not sure if it's worth it or not. Can still be done in a follow-up if we want it. For now, this PR does two things: 1. Pass the `DiagCtxt` to the doctest parser to emit the warning. 2. Correctly generate the `Span` to where the doctest is starting (I hope the way I did it isn't too bad either...). cc `@fmease` r? `@notriddle`
Fast path for processing some obligations in the new solver Fast path applies to: - Dyn compatibility predicates - Region and type outlives predicates - Trivially sized predicates
Update IDEs to use rustfmt 2024, fix Zed settings Update IDEs to use rustfmt 2024, fix Zed settings - Update IDE `rust-analyzer` settings to use 2024 rather than 2021. - Fix Zed settings by removing `${workspaceFolder}/` from paths.
Use the fn_span when emitting function calls for better debug info. This especially improves the developer experience for long chains of function calls that span multiple lines, which is common with builder patterns, chains of iterator/future combinators, etc. try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc-1 try-job: arm-android r? `@jieyouxu`
Implement `advance_by` via `try_fold` for `Sized` iterators When `try_fold` is overriden, it is usually easier for compilers to optimize. Example difference: https://iter.godbolt.org/z/z8cEfnKro
Describe lifetime of call argument temporaries passed indirectly Fixes #132014.
fixes: ide-assists, generate_new indent loses
Change import prefix default to be by crate
…ndent fix: ide-assists, generate mut trait impl indent
Subtree update of `rust-analyzer` r? `@ghost`
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 ```
replace TraitRef link memory.md Hi, I fixed broken links in the documentation and replaced them with working ones. https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TraitRef.html - old link https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.TraitRef.html - new link
interpret/allocation: Fixup type for `alloc_bytes` This can be `FnOnce`, which helps us avoid an extra clone in rust-lang/miri#4343 r? RalfJung
…i-obk Handle ed2021 precise capturing of unsafe binder Missing pieces from last pr. r? oli-obk Fixes rust-lang/rust#141655
rustbook: Bump versions of `onig` and `onig_sys` This fixes the build on GCC 15.
core: unstably expose atomic_compare_exchange so stdarch can use it Due to rust-lang/stdarch#1655, cleaning up the atomic intrinsics will be a bunch of extra work: stdarch directly calls them [here](https://github.com/rust-lang/stdarch/blob/8764244589373b8b48864c0ad11fd9233c672249/crates/core_arch/src/x86_64/cmpxchg16b.rs#L58-L74). Instead of duplicating that match, stdarch should use what we have in libcore, so let's expose that. r? `@bjorn3`
Add `rustc_diagnostic_item` to `sys::Mutex` methods For an ongoing project for adding a concurrency model checker to Miri we need to be able to intercept locking/unlocking operations on standard library mutexes. This PR adds diagnostic items to the relevant calls `lock`, `try_lock` and `unlock` for the `sys::Mutex` implementation on the targets we care about. This PR also makes the internals of `pthread::Mutex` less public, to reduce the chance of anyone locking/unlocking a mutex without going through the intercepted methods. r? ``@RalfJung``
Add eholk to compiler reviewer rotation Now that we have work queue limits on triagebot, I'm happy to share some of the review load. r? ``@wesleywiser``
Rollup of 16 pull requests Successful merges: - rust-lang/rust#136429 (GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants) - rust-lang/rust#138139 (Emit warning while outputs is not exe and prints linkage info) - rust-lang/rust#141104 (Test(fs): Fix `test_eq_windows_file_type` for Windows 7) - rust-lang/rust#141477 (Path::with_extension: show that it adds an extension where one did no…) - rust-lang/rust#141533 (clean up old rintf leftovers) - rust-lang/rust#141612 (Call out possibility of invariant result in variance markers) - rust-lang/rust#141638 (Use `builtin_index` instead of hand-rolling it) - rust-lang/rust#141643 (ci: verify that codebuild jobs use ghcr.io) - rust-lang/rust#141675 (Reorder `ast::ItemKind::{Struct,Enum,Union}` fields.) - rust-lang/rust#141680 (replace TraitRef link memory.md) - rust-lang/rust#141682 (interpret/allocation: Fixup type for `alloc_bytes`) - rust-lang/rust#141683 (Handle ed2021 precise capturing of unsafe binder) - rust-lang/rust#141684 (rustbook: Bump versions of `onig` and `onig_sys`) - rust-lang/rust#141687 (core: unstably expose atomic_compare_exchange so stdarch can use it) - rust-lang/rust#141690 (Add `rustc_diagnostic_item` to `sys::Mutex` methods) - rust-lang/rust#141702 (Add eholk to compiler reviewer rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 4 pull requests Successful merges: - rust-lang/rust#138285 (Stabilize `repr128`) - rust-lang/rust#139994 (add `CStr::display`) - rust-lang/rust#141571 (coretests: extend and simplify float tests) - rust-lang/rust#141656 (CI: Add cargo tests to aarch64-apple-darwin) 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
Do not get proc_macro from the sysroot in rustc With the stage0 refactor the proc_macro version found in the sysroot will no longer always match the proc_macro version that proc-macros get compiled with by the rustc executable that uses this proc_macro. This will cause problems as soon as the ABI of the bridge gets changed to implement new features or change the way existing features work. To fix this, this commit changes rustc crates to depend directly on the local version of proc_macro which will also be used in the sysroot that rustc will build.
Bump rustc-perf and update PGO crates Updates rustc-perf to rust-lang/rustc-perf@8158f78, and updates the crates. r? `@Kobzol`
Make some assertions in solver into debug assertions These may or may not be expensive :> r? lcnr
rustdoc: cleanups relating to allocations These commits generally clean up the code a bit and also reduce allocation rates a bit. r? `@camelid`
rustc_codegen_llvm: use `threadlocal.address` intrinsic to access TLS Fixes #136044 r? `@nikic`
bootstrap: Remove `bin_root` from `PATH` It's not currently load bearing in typical setups on typical targets. Basically, if it passes the standard CI, then we can remove it, I think. If someone later reports this breaking the build, then we can address it in a more fine grained way. E.g. add it to `PATH` last and not first, only on specific targets, and only if specific files are not already found in `PATH` directories. Fixes [#t-infra/bootstrap > Build broken in MSYS2 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Build.20broken.20in.20MSYS2/near/520709527)
Add fast path for maybe-initializedness in liveness r? `@matthewjasper` Correct me if I'm wrong Matthew, but my understanding is that 1. `MaybeInitializedPlaces` is currently eagerly computed, in `do_mir_borrowck` 2. but this data is only used in liveness 3. and `liveness::trace` actually only uses it for drop-liveness This PR moves the computation to `liveness::trace` which looks to be its only use-site. We also add a fast path there, so that it's only computed by drop-liveness. This is interesting because 1) liveness is only computed for relevant live locals, 2) drop-liveness is only computed for relevant live locals with >0 drop points; 0 is the common case from our benchmarks, as far as I can tell, so even just computing the entire data lazily helps. It seems possible to also reduce the domain here, and speed up the analysis for the cases where it has to be computed -- so I've left a fixme for that, and may look into it soon. (I've come upon this while doing implementation work for polonius, so don't be too enamored with possible wins: the goal is to reduce the eventual polonius overhead and make it more palatable 😓)
Revert "increase perf of charsearcher for single ascii characters" This reverts commit 245bf503e2a948ac98170516d11df632e85a948b (PR rust-lang/rust#141516). It caused a large `doc` perf. regression in rust-lang/rust#141605.
Do not move thread-locals before dropping Fixes rust-lang/rust#140816. I also (potentially) improved the speed of `get_or_init` a bit by having an explicit hot/cold path. We still move the value before dropping in the event of a recursive initialization (leading to double-initialization with one value being silently dropped). This is the old behavior, but changing this to panic instead would involve changing tests and also the other OS-specific `thread_local/os.rs` implementation, which is more than I'd like in this PR.
…yUwU Avoid over-counting of `UsePath` in the HIR stats. Currently we over-count. Details in the individual commits. r? `@BoxyUwU`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Latest update from rustc.