Skip to content

Rollup of 14 pull requests#159236

Closed
JonathanBrouwer wants to merge 58 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-GB2gMaX
Closed

Rollup of 14 pull requests#159236
JonathanBrouwer wants to merge 58 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-GB2gMaX

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

qaijuang and others added 30 commits June 12, 2026 20:57
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.
@rustbot rustbot added A-tidy Area: The tidy tool O-windows Operating system: Windows PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 13, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-*

@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9771bd2 has been approved by JonathanBrouwer

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 13, 2026
@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit 9771bd2 with merge ffae783

To cancel the try build, run the command @bors try cancel.

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-*
@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
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)
@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 13, 2026
@rust-bors

rust-bors Bot commented Jul 13, 2026

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

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 13, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors try cancel

@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rand_xorshift test:false 0.194
error: trailing semicolon in macro used in expression position
   --> library/std_detect/src/detect/macros.rs:78:45
    |
 50 | / ...   macro_rules! $macro_name {
 51 | | ...       $(
 52 | | ...           ($feature_lit) => {
 53 | | ...               $crate::detect_feature!($feature, $feature_lit $(, without cfg check: $feature_cfg_check)? $(: $($target_featur...
...   |
 78 | | ...               $crate::$macro_name!($t);
    | |                                           ^
...   |
 87 | | ...       };
 88 | | ...   }
    | |_______- in this expansion of `is_x86_feature_detected!`
    |
   ::: library/std_detect/tests/macro_trailing_commas.rs:109:13
    |
109 |       let _ = is_x86_feature_detected!("sse",);
    |               -------------------------------- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
    = note: `#[deny(semicolon_in_expressions_from_macros)]` (part of `#[deny(future_incompatible)]`) on by default

[RUSTC-TIMING] macro_trailing_commas test:true 0.093
error: could not compile `std_detect` (test "macro_trailing_commas") due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] rand test:false 1.576

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_literal_escaper test:false 0.189
error: trailing semicolon in macro used in expression position
  --> library/std_detect/src/detect/macros.rs:78:45
   |
50 | / ...   macro_rules! $macro_name {
51 | | ...       $(
52 | | ...           ($feature_lit) => {
53 | | ...               $crate::detect_feature!($feature, $feature_lit $(, without cfg check: $feature_cfg_check)? $(: $($target_feature...
...  |
78 | | ...               $crate::$macro_name!($t);
   | |                                           ^
...  |
87 | | ...       };
88 | | ...   }
   | |_______- in this expansion of `is_aarch64_feature_detected!`
   |
  ::: library/std_detect/tests/macro_trailing_commas.rs:65:13
   |
65 |       let _ = is_aarch64_feature_detected!("fp",);
   |               ----------------------------------- in this macro invocation
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
   = note: `#[deny(semicolon_in_expressions_from_macros)]` (part of `#[deny(future_incompatible)]`) on by default

[RUSTC-TIMING] macro_trailing_commas test:true 0.055
error: could not compile `std_detect` (test "macro_trailing_commas") due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] rustc_demangle test:false 1.165

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-json Area: Rustdoc JSON backend A-rustdoc-search Area: Rustdoc's search feature A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool O-windows Operating system: Windows PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.