Rustc pull update#2192
Merged
Merged
Conversation
add `vpdpbusd` avx512 intrinsic
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: e8f3cfc0de70bf82583591f6656e1fba3140253e Filtered ref: 5837f859c413e836e4fd1eb4985632c2f62c7db0 Upstream diff: rust-lang/rust@7fefa09...e8f3cfc This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
…-pipe Refactor libc pipe tests to use utility functions for error handling and data operations
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: f57b9e6f565a1847e83a63f3e90faa3870536c1f Filtered ref: dd835ad11d6c5cea520a087bb620e3643e2dbf0f Upstream diff: rust-lang/rust@e8f3cfc...f57b9e6 This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
…-affinity Refactor CPU affinity tests to use errno_check for error handling
…-time Refactor libc time tests to use errno_check for error handling
…-fs-symlink Refactor `libc-fs-symlink` tests to use errno_result
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@5a07626 Filtered ref: rust-lang/miri@cc20862 Upstream diff: rust-lang/rust@d10ac47...5a07626 This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
document guidelines for which shims have a place in Miri
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@e96bb7e Filtered ref: rust-lang/miri@4304ab0 Upstream diff: rust-lang/rust@873d468...e96bb7e This merge was created using https://github.com/rust-lang/josh-sync.
add a bug to the trophy shelf
Automatic Rustup
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@35a31ba Filtered ref: rust-lang/miri@b436646 Upstream diff: rust-lang/rust@e96bb7e...35a31ba This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
trophy case: oneshot data race
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@1d05e3c Filtered ref: rust-lang/miri@c06e02d Upstream diff: rust-lang/rust@878374e...1d05e3c This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
Add a validity testcase for uninhabited variants
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@f889772 Filtered ref: rust-lang/miri@1fa28eb Upstream diff: rust-lang/rust@9f4b56a...f889772 This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
Simplify wildcard datastructure.
Feat: aarch64 intrinsics to make MIRI work on chacha20
chore: fix typos suggested by typos-cli
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@7bee525 Filtered ref: rust-lang/miri@c878532 Upstream diff: rust-lang/rust@47611e1...7bee525 This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@3c9faa0 Filtered ref: rust-lang/miri@4003d54 Upstream diff: rust-lang/rust@7bee525...3c9faa0 This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
[perf] Specialize common `(1, 1)` case for arg unification. While `DeepRejectCtxt::args_may_unify_inner` might be called with different numbers of obligation and impl args, the `(1, 1)` length case is very common: single-generic-param ADTs, trait references whose only generic is `Self`, etc. Offer a fast path for that simple case, so that we avoid invoking `iter::zip(...).all(predicate)` iterator machinery given that it isn't necessary there. We considered, and ultimately rejected, adding a separate specialization for the `(0, 0)` case since benchmarks indicated it wasn't cost-effective. r? @oli-obk **AI disclosure:** The optimization opportunity here was discovered as part of a systematic probe for missed optimizations utilizing both traditional and AI tools. The code here was initially prototyped and vetted by AI tools, followed by additional manual work. I secured approval in advance from the designated reviewer. I stand behind the quality of the code I'm submitting, and I vouch it's as good or better compared to if I had written every line by my own hand.
Inline some `Symbol` functions I noticed in some profiles that de-interning the symbols was relatively hot. I was trying to experiment with some sharding scheme, where the symbols would be split into N interners based on their first character, but I couldn't get it to work, probably due to some complexities around pre-interned `'static` keywords and symbol comparison. So I at least tried interning these two functions, which seems to produce very minor perf. gains on instruction counts. r? @nnethercote
perf: Rework read deduplication with pooled read recorders Every dependency read goes through DepGraph::read_index, which must decide whether the current task has already recorded the read. Small tasks used a linear scan; larger ones built an FxHashSet, rebuilt for every task and rehashed as it grew, while the reads themselves were collected in an EdgesVec allocated and freed per task. Larger tasks now reuse a recorder from a global pool, so the hash set and read list allocations are amortized across tasks. EdgesVec is removed.
Lang item cleanups a grab bag of cleanups around lang item collection and various documentation things I found while poking around that area r? @JonathanBrouwer
…chenkov Resolver: Wrap arenas in `WorkerLocal` In preperation of parallel import resolution rust-lang/rust#158845 this pr wraps the resolver arenas in `WorkerLocal` to ensure we don't need any synchronization to access an arena. This is common in the compiler. Also, when building the resolution table of an external module, we first create a seperate table and fill that one, after which we replace the empty table with that new table. (Prep Work for rust-lang/rust#158845) And a manual inline of `define_extern`. r? @petrochenkov
…rguments, r=petrochenkov delegation: support `Self` mapping adjustments for non-first arguments This PR implements initial version of Self mapping adjustments of all arguments that are needed to be mapped. The method probing routine is reused in order to find adjustments for each mapped argument, then they are processed in the same way the receiver is processed in delegation. The current solution is a bit hacky, explained in the comment: ```rust /// Hack for applying method probing routine for arbitrary types /// in order to get adjustments as if they were at receiver position. /// Used only for delegation's `Self` arguments mapping. /// FIXME(fn_delegation): now this hack is used, however in perfect world /// we would like to separate adjustments finding logic from probe context, /// if we do so we will be able to find wanted adjustments given only two /// types without reusing the whole method probing routine ``` The next part of Self mapping is to support heuristics to map complex return types: `Self` -> `Box<Arc<Self>>`. Part of rust-lang/rust#118212. r? @petrochenkov
…eo,teor2345 When both expected and found are the same type, use only name instead of full path This makes the output marginally shorter, and further visually differentiates part of the types that are different by deemphasazing those that are the same.
Support `#[track_caller]` on EII declarations Tracking issue: rust-lang/rust#125418 Zulip thread: [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Questions.20about.20support.20.60.23.5Btrack_caller.5D.60.20on.20EII.20declaration) `#[track_caller]` is currently rejected on EII declarations by the catch-all in `split_attrs`. This routes it onto the foreign item and derives it onto every implementation during codegen. The foreign item is the symbol callers link against, so it must carry the flag for call sites to append the caller location. It is routed onto the foreign item only, not the default impl — `check_attr` already rejects `#[track_caller]` on EII implementations (`EiiWithTrackCaller`), since the attribute is part of the ABI. The flag is then derived onto each implementation in `codegen_attrs`: if the foreign item is `#[track_caller]`, every impl gets the flag too. The shim in `add_function_aliases` takes its ABI from the impl's `fn_abi`, so if any impl lacked the flag the caller-location argument would be silently dropped rather than reported as a type error. Deriving it keeps default and explicit impls in sync without requiring users to repeat the attribute. `#[track_caller]` on a foreign item is an already-supported path (see `tests/ui/rfcs/rfc-2091-track-caller/track-caller-ffi.rs`); this just wires it into EII. Statics are unaffected — `#[track_caller]` isn't a valid target on statics and is rejected as before. r? @jdonszelmann @bjorn3
Small refactorings in `need_type_info` module r? @lcnr This supports low priority impl diagnostic.
…crum Bump rustc-demangle to 0.1.28 This PR is part of the splat lang experiment: rust-lang/rust#153629 It brings in the changes from rust-lang/rustc-demangle#90, which encode splatted types with a `w` prefix in type mangling. This is required to fix the symbol clashes in rust-lang/rust#158644. We need to upgrade the compiler and standard library to avoid "can't demangle" panics or errors. Some tools might work without the upgrade, but we might as well do it there as well. @rustbot label +C-enhancement +F-splat +T-compiler +A-name-mangling
…enkov Avoid using probe self_ty for delegation arguments Fixes rust-lang/rust#159128 The old code temporarily wrote `pick.self_ty` into the first argument's node type before normal argument checking. That `self_ty` can contain inference variables created inside the method-probe transaction, so resolving it later in the real function checking context could cause the ICE in `ena`.
…s, r=TaKO8Ki Consider structurally impossible Sized predicates in MIR Fixes rust-lang/rust#156051 `ImpossiblePredicates` filters predicates mentioning local generics before invoking the trait solver, which avoids normalization and solver work in generic contexts, thereby skipping predicates such as `dyn Trait<T>: Sized`, even though they are impossible for every substitution. This PR adds a narrow structural fast path for positive `Sized` predicates whose self type is known-unsized without normalization, letting the pass clear unreachable bodies before later MIR opts can evaluate `SizedTypeProperties` constants such as `size_of::<Self>()`.
Expose more info about ADTs and functions in rustc_public This allows users of `rustc_public` to do more complex navigation through data structures by exposing the following info: * `AdtDef::generics_of` - Get the generics for the ADT. * `AdtDef::inherent_impls` - Get all the impls for the ADT. * `FnDef::associated_item` - Get the trait or impl block that contains the function if it exists. * `FnDef::generics_of` - get the generics for a given function. * `ImplDef::generics_of` - Get the generics for the impl block. * `ImplDef` implements `CrateDefType` - figure out the type of the impl block with `CrateDefType::ty()` or get the normalized type with `CrateDefType::ty_with_args()`. This was partially written with the help of Gemini, but I reviewed the code it generated.
Clarify `as_uninit_mut` may point to uninitialized memory Tracking issue: rust-lang/rust#75402 This PR clarifies the safety documentation for `*mut T::as_uninit_mut`. Unlike `as_mut`, this method creates a reference to `MaybeUninit<T>`, so the source pointer may point to uninitialized memory. The pointer still must either be null or satisfy the pointer-to-reference conversion requirements. After adding the supplementary information, the safety documentation of `*mut T::as_uninit_mut` is consistent with `*mut T::as_uninit_ref`, `*const T::as_uninit_ref` and `std::ptr::NonNull::as_uninit_mut`. This is a documentation-only change. Tests were not added because this only updates API docs.
…uwer Add `#[rustc_test_entrypoint_marker]` r? @JonathanBrouwer cc: @Nadrieril @N1ark @aDotInTheVoid Some context: a bunch of tooling around rustc likes to find entry points. This is easy for `main`, it's a lang item. But tests aren't as easy. There is already a similar marker for the data structure associated with tests, but if you want to do for example dynamic analysis, you want just the defid of the function you can call to start the tests. This is that marker. There's a test using a rustc driver that the attr indeed shows up and marks the test functions. @Nadrieril and @N1ark asked for this kind of behavior. I talked to @aDotInTheVoid about whether we should do things like this where we cannot really guarantee the stability or even use it inside rustc. The thing is, we don't provide staboility guarantees, it's just a useful little thing to have for as long as its there and it doesn't bother anyone either. It's up to tool authors to deal with breakage we may introduce.
Some minor ast validation and visiting cleanups Originally I wanted to mutate the AST during validation, but I will first explore mutating it less and moving more things to arenas. Let's land the parts unrelated to actual mutation. <details> <summary>Original PR description</summary> I think this could be useful for having to handle weird cases less later in the compiler. Either by replacing things with error nodes (e.g. ty/expr), or by editing out the invalid elements (`const fn` -> `fn` in trait methods or trait impls). </details>
doc: clarify attr parser APIs Follow up on rust-lang/rust#155696 by documenting the higher-level `AcceptContext` helpers for common argument shapes. `MetaItemParser` remains the lower-level tool for attributes with custom restricted syntax. Remove the stale FIXME now that the helpers are available.
…uwer Rollup of 13 pull requests Successful merges: - rust-lang/rust#157706 (Deny `todo!()` in tidy) - rust-lang/rust#158535 (Support `#[track_caller]` on EII declarations) - rust-lang/rust#158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - rust-lang/rust#158846 (Fix unused variable warnings for diverging expressions) - rust-lang/rust#159002 (Small refactorings in `need_type_info` module) - rust-lang/rust#159202 (Bump rustc-demangle to 0.1.28) - rust-lang/rust#159216 (Avoid using probe self_ty for delegation arguments) - rust-lang/rust#156609 (Consider structurally impossible Sized predicates in MIR) - rust-lang/rust#157993 (Expose more info about ADTs and functions in rustc_public) - rust-lang/rust#158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - rust-lang/rust#158854 (Add `#[rustc_test_entrypoint_marker]`) - rust-lang/rust#158998 (Some minor ast validation and visiting cleanups) - rust-lang/rust#159123 (doc: clarify attr parser APIs)
Eagerly check for ambiguity in macro parsing This PR implements an important step leading up to the BFS->DFS change: it makes ambiguity detection (as occurs when parsing meta-variables and reaching EOF) eager. Rather than accumulating the `bb_mps` and `eof_mps` lists, then checking that a single valid parse exists, this PR introduces a `check_for_ambiguity()` method that gets called as soon as the relevant `MatcherLoc` is observed. `check_for_ambiguity()` immediately drains `cur_mps` instead of waiting for the outer loop to do so, and evaluates the mps within a "checking for ambiguity" context. This change was complicated by the fact that `bb_mps` was relied on for error messages; it was passed along to `Tracker::ambiguity()`. The same is true for `next_mps`. The first few commits of this PR (after pending rebases) add state to `Tracker` so that it can compute the relevant diagnostic information independently of `bb_mps`. This PR complicates the control flow around `parse_tt_inner()` in subtle ways. I'm not super happy about it, but I think it will become easier to understand again once a DFS approach is implemented. ~This PR contains rust-lang/rust#158894 and rust-lang/rust#158974. I'll rebase on top of `main` once they're both merged.~ Best reviewed commit-by-commit. r? @nnethercote
Shrink `ast::Expr64` From 72 bytes to 64 bytes, by boxing `ForLoop`, which is the biggest variant. There are now 11 `ExprKind` variants that are 31 bytes, so future improvements here will be very difficult.
This updates the rust-version file to fcbe7917ba18120d9eda136f1c7c5a60c78e554e.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@fcbe791 Filtered ref: 4742894 Upstream diff: rust-lang/rust@8e15021...fcbe791 This merge was created using https://github.com/rust-lang/josh-sync.
Collaborator
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @folkertdev (or someone else) some time within the next two weeks. Why was this reviewer chosen?The reviewer was selected based on:
|
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
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.