Rollup of 6 pull requests#159260
Closed
jhpratt wants to merge 20 commits into
Closed
Conversation
…hat the ty vars are equal
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.
…biguity, r=petrochenkov resolve: fix effective visibilities for items in ambiguous glob sets Fixes rust-lang#159038 (1.96.1 → 1.97.0 regression; details there). When an item is glob-imported twice at different visibilities, effective visibility was computed from whichever declaration arrived first, not the most visible one. An exported item could then get no MIR encoded, and downstream crates fail with ``missing optimized MIR``. Fix: also walk the most visible declaration's re-export chain (`update_decl_chain`, recursing into `ambiguity_vis_max`). Lint behavior unchanged. Two regression tests added; `tests/ui/{imports,privacy,resolve}` pass with every rust-lang#154149 / rust-lang#156284 test unmodified. @rustbot label +A-resolve +A-visibility +T-compiler +regression-from-stable-to-stable
…=lcnr,wafflelapkin Fix trait method resolution on an adjusted never type Fixes rust-lang#143349 r? @WaffleLapkin cc @lcnr
…al-casts-dyn-any, r=folkertdev Skip trivial cast lint for trait object upcasts Fixes rust-lang#148219 In the case like `(other as &dyn Any).downcast_ref::<T>()`, removing the cast can change method lookup, so the cast is not always trivial, so skip lint on it.
Update books ## rust-lang/book 3 commits in 05d114287b7d6f6c9253d5242540f00fbd6172ab..dd7ab4f4f4541adf4aa2a872cdac06c206b73288 2026-07-10 19:43:43 UTC to 2026-06-29 20:56:02 UTC - Update to Rust 1.97 (rust-lang/book#4799) - doc: upgrade rand dependency to v0.10.1 in book listings and text (rust-lang/book#4756) - Explicitly state "compilation modes" (rust-lang/book#3517) ## rust-lang/edition-guide 1 commits in c3c0f0b3da26610138b7ba7663f60cd2c68cf184..53686db907c45268d1b323afd9a3545a37abbced 2026-07-10 17:05:04 UTC to 2026-07-10 17:05:04 UTC - Fix typo of key name `resolver.incompatible-rust-versions` (rust-lang/edition-guide#385) ## rust-lang/reference 4 commits in 86635e30bf861a038dc197d7e16fd09e7e514e7a..afdc77bab886d4455c11247cdd32391bfab636ae 2026-07-09 16:48:44 UTC to 2026-07-06 14:48:32 UTC - Fix the tagged-union pattern-matching recommendation (rust-lang/reference#2303) - Structs with no fields or all-ZST fields are ZSTs (rust-lang/reference#2262) - macros.md: fix case (rust-lang/reference#2307) - Bump railroad-dependency (rust-lang/reference#2305) ## rust-lang/rust-by-example 1 commits in d3117f6c873acbbf331c1d510371d061dfcc975c..15308f3e951814ef3475d2b58f48276e6b17b9af 2026-07-06 10:14:39 UTC to 2026-07-06 10:14:39 UTC - Update Chinese translations in `zh.po` (rust-lang/rust-by-example#2025)
…ias, r=Urgau compiler: Remove `-Zmutable-noalias` Let us mark the end of an era. The `noalias` optimization has been working relatively well for some time now. There may still be issues to sort out with `noalias`. If so, those are mostly on LLVM's side, where it may need to have a better model of what `noalias` means as that is necessary for soundly inferring it. We also may need to not add `noalias` somewhere we currently do, if our semantics do not actually match that. Either way, it doesn't seem useful to configure on a compilation-wide basis.
…thanBrouwer Rename `errors.rs` file to `diagnostics.rs` (13/N) Follow-up of rust-lang#157485. r? @JonathanBrouwer
Member
Author
|
@bors r+ rollup=never p=5 |
Contributor
Contributor
|
⌛ Testing commit 92643cf with merge a058ee9... Workflow: https://github.com/rust-lang/rust/actions/runs/29303981528 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 14, 2026
Rollup of 6 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #156047 (Fix trait method resolution on an adjusted never type) - #159061 (Skip trivial cast lint for trait object upcasts) - #159241 (Update books) - #159248 (compiler: Remove `-Zmutable-noalias`) - #159250 (Rename `errors.rs` file to `diagnostics.rs` (13/N))
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Merged
Contributor
|
PR #159241, which is a member of this rollup, was unapproved. This rollup was thus unapproved. Auto build was cancelled due to unapproval. Cancelled workflows: |
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:
-Zmutable-noalias#159248 (compiler: Remove-Zmutable-noalias)errors.rsfile todiagnostics.rs(13/N) #159250 (Renameerrors.rsfile todiagnostics.rs(13/N))r? @ghost
Create a similar rollup