Rollup of 15 pull requests#159240
Closed
JonathanBrouwer wants to merge 64 commits into
Closed
Conversation
…hat the ty vars are equal
There is only one place where `SourceKindSubdiag` is used without `SourceKindMultiSuggestion`; it doesn't seem useful to distinguish between them (I have no idea what either of the names means tbh)
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.
Since PR 154149, when one item is glob-imported into a module twice with different visibilities, the first-arrived declaration stays in the resolution slot and the most visible declaration of the ambiguous glob set is only recorded in `ambiguity_vis_max`. `DeclData::vis()` returns the max, so name resolution, metadata reexports and `cross_crate_inlinable` export the item at the maximum visibility, but `set_bindings_effective_visibilities` walked only the slot-resident declaration's reexport chain. When the restricted route arrives first, the definition's effective visibility caps at the restricted visibility while the item is still exported: spurious dead_code, the item missing from reachable_set, should_encode_mir returning false, and downstream crates failing with "missing optimized MIR" (a 1.96.1 -> 1.97.0 stable-to-stable regression). Generalize the one-level `ambiguity_vis_max` update that PR 154149 added in `update_import` (to keep the most visible import from being reported as unused) into a walk of that declaration's whole reexport chain: extract the chain walk into `update_decl_chain` and recurse into `ambiguity_vis_max` at every hop, so the most visible declaration drives the effective visibility of everything on its route, including the final definition. Updates are monotone, so the dual walk is order-independent. The `ambiguous_import_visibilities` lint and the PR 156284 diagnostic suppression are untouched.
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 13, 2026
…uwer Rollup of 15 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #156047 (Fix trait method resolution on an adjusted never type) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158804 (Clarify `as_uninit_mut` may point to uninitialized memory) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
Contributor
|
💔 Test for 776dc9e failed: CI. Failed job:
|
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #156047, which is a member of this rollup, was unapproved. |
Contributor
Author
|
That PR is not the only problem here tho..., looking further |
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.
Successful merges:
todo!()in tidy #157706 (Denytodo!()in tidy)#[track_caller]on EII declarations #158535 (Support#[track_caller]on EII declarations)need_type_infomodule #159002 (Small refactorings inneed_type_infomodule)as_uninit_mutmay point to uninitialized memory #158804 (Clarifyas_uninit_mutmay point to uninitialized memory)#[rustc_test_entrypoint_marker]#158854 (Add#[rustc_test_entrypoint_marker])r? @ghost
Create a similar rollup