Rollup of 14 pull requests#159236
Closed
JonathanBrouwer wants to merge 58 commits into
Closed
Conversation
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
Author
Contributor
Contributor
|
⌛ Trying commit 9771bd2 with merge ffae783… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/29265172410 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 13, 2026
Rollup of 14 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
Contributor
|
⌛ Testing commit 9771bd2 with merge 5fd724e... Workflow: https://github.com/rust-lang/rust/actions/runs/29267235202 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 13, 2026
…uwer Rollup of 14 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #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) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
Contributor
|
PR #159222, which is a member of this rollup, was unapproved. This rollup was thus unapproved. Auto build was cancelled due to unapproval. Cancelled workflows: |
Contributor
Author
|
@bors try cancel |
Contributor
|
Try build cancelled. Cancelled workflows: |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
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)#[rustc_test_entrypoint_marker]#158854 (Add#[rustc_test_entrypoint_marker])r? @ghost
Create a similar rollup