Skip to content

Rollup of 6 pull requests#159260

Closed
jhpratt wants to merge 20 commits into
rust-lang:mainfrom
jhpratt:rollup-icC05vL
Closed

Rollup of 6 pull requests#159260
jhpratt wants to merge 20 commits into
rust-lang:mainfrom
jhpratt:rollup-icC05vL

Conversation

@jhpratt

@jhpratt jhpratt commented Jul 14, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

JonathanBrouwer and others added 20 commits June 27, 2026 12:42
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
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 14, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 14, 2026
@jhpratt

jhpratt commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 92643cf has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2026
@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
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))
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING:start] test::LintDocs { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu }
[TIMING:start] doc::RustcBook { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, validate: true }
Generating lint docs (aarch64-unknown-linux-gnu)
##[group]Running stage2 lint-docs (stage1 -> stage2, aarch64-unknown-linux-gnu)
error: failed to test example in lint docs for `method_call_on_diverging_infer_var` in /checkout/compiler/rustc_lint_defs/src/builtin.rs:5540: the lint example has `ignore`, but also contains the {{produces}} marker

The documentation generator cannot generate the example output when the example is ignored.
Manually include the sample output below the example. For example:

/// ```rust,ignore (needs command line option)
/// #[cfg(widnows)]
/// fn foo() {{}}
/// ```
///
/// This will produce:
/// 
/// ```text
/// warning: unknown condition name used
///  --> lint_example.rs:1:7
///   |
/// 1 | #[cfg(widnows)]
///   |       ^^^^^^^
///   |
///   = note: `#[warn(unexpected_cfgs)]` on by default
/// ```

Replacing the output with the text of the example you compiled manually yourself.


This error was generated by the lint-docs tool.
This tool extracts documentation for lints from the source code and places
them in the rustc book. See the declare_lint! documentation
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/macro.declare_lint.html
for an example of the format of documentation this tool expects.

To re-run these tests, run: ./x.py test --keep-stage=0 src/tools/lint-docs
The --keep-stage flag should be used if you have already built the compiler
and are only modifying the doc comments to avoid rebuilding the compiler.

Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools-bin/lint-docs --build-rustc-stage 1 --src /checkout/compiler --out /checkout/obj/build/aarch64-unknown-linux-gnu/md-doc/rustc/src/lints --rustc /checkout/obj/build/aarch64-unknown-linux-gnu/stage1/bin/rustc --rustc-target aarch64-unknown-linux-gnu --validate` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1625:23
Executed at: src/bootstrap/src/core/build_steps/doc.rs:1442:13

--- BACKTRACE vvv
   0: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at /checkout/src/bootstrap/src/utils/exec.rs:938:17
   1: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at /checkout/src/bootstrap/src/utils/exec.rs:830:21
   2: <bootstrap::utils::exec::ExecutionContext>::run
             at /checkout/src/bootstrap/src/utils/exec.rs:740:45
   3: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at /checkout/src/bootstrap/src/utils/exec.rs:338:27
   4: <bootstrap::core::build_steps::doc::RustcBook as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/doc.rs:1442:13
   5: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::doc::RustcBook>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1650:36
   6: <bootstrap::core::build_steps::test::LintDocs as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:4026:17
   7: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::LintDocs>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1650:36
   8: <bootstrap::core::build_steps::test::LintDocs as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:4013:21
   9: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:480:13
  10: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:142:22
  11: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1177:9
  12: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1156:14
  13: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:802:25
  14: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:149:11
  15: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/ops/function.rs:250:5
  16: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/sys/backtrace.rs:166:18
  17: std::rt::lang_start::<()>::{closure#0}
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/rt.rs:206:18
  18: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/ops/function.rs:287:21
  19: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:576:43
  20: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:544:19
  21: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panic.rs:359:14
  22: std::rt::lang_start_internal::{closure#0}
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/rt.rs:175:24
  23: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:576:43
---
  30: __libc_start_main
  31: _start


Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `--stage 2 test --skip tidy --skip src/tools/rust-analyzer --skip tests --skip library --skip tidyselftest`
Currently active steps:
test::LintDocs { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu } at src/bootstrap/src/core/build_steps/test.rs:4013
doc::RustcBook { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, validate: true } at src/bootstrap/src/core/build_steps/test.rs:4026
Build completed unsuccessfully in 0:38:51

@jhpratt jhpratt mentioned this pull request Jul 14, 2026
@jhpratt jhpratt closed this Jul 14, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 14, 2026
@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants