Don't allow subdiagnostic to use variables from their parent#153190
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Feb 28, 2026
Merged
Don't allow subdiagnostic to use variables from their parent#153190rust-bors[bot] merged 2 commits intorust-lang:mainfrom
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
Conversation
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt HIR ty lowering was modified cc @fmease
cc @davidtwco, @TaKO8Ki |
8 tasks
JonathanBrouwer
commented
Feb 27, 2026
| pub struct NonStaticCrateDep { | ||
| /// It's different from `crate_name` in main Diagnostic. | ||
| pub crate_name_: Symbol, | ||
| pub sub_crate_name: Symbol, |
Contributor
Author
There was a problem hiding this comment.
This fixes a bug! The message should have referred to crate_name_.
I don't think there's an easy way to write a regression test for this, but this shows that this PR is doing good
Contributor
|
r=me on ci |
Contributor
Author
|
@bors r=jdonszelmann rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 28, 2026
… r=jdonszelmann Don't allow subdiagnostic to use variables from their parent Tangentially related to rust-lang#151366 This is PR 1/2 for structured diagnostics, will do the unstructured ones next. After the second PR I will be able to remove some code that should compensate for this PR being positive. Regardless of this PR having a positive diff, I feel that subdiagnostics being able to use variables from their parent is very confusing, so this is for the better,. r? @jdonszelmann
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 28, 2026
… r=jdonszelmann Don't allow subdiagnostic to use variables from their parent Tangentially related to rust-lang#151366 This is PR 1/2 for structured diagnostics, will do the unstructured ones next. After the second PR I will be able to remove some code that should compensate for this PR being positive. Regardless of this PR having a positive diff, I feel that subdiagnostics being able to use variables from their parent is very confusing, so this is for the better,. r? @jdonszelmann
This was referenced Feb 28, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 28, 2026
…uwer Rollup of 12 pull requests Successful merges: - #153211 (`rust-analyzer` subtree update) - #149027 (Improve cross-crate trait impl param mismatch suggestions ) - #152730 (add field representing types) - #153136 (Correctly handle `#[doc(alias = "...")]` attribute on inlined reexports) - #152165 (Normalize capture place `ty`s to prevent ICE) - #152615 (refactor 'valid for read/write' definition: exclude null) - #153109 (Fix LegacyKeyValueFormat report from docker build: aarch64-gnu-debug) - #153172 (Fix comment about placeholders) - #153187 (Fix ICE when macro-expanded extern crate shadows std) - #153190 (Don't allow subdiagnostic to use variables from their parent) - #153200 (Remove redundant clone) - #153216 (mark two polonius tests as known-bug)
rust-timer
added a commit
that referenced
this pull request
Feb 28, 2026
Rollup merge of #153190 - JonathanBrouwer:subdiag_variables, r=jdonszelmann Don't allow subdiagnostic to use variables from their parent Tangentially related to #151366 This is PR 1/2 for structured diagnostics, will do the unstructured ones next. After the second PR I will be able to remove some code that should compensate for this PR being positive. Regardless of this PR having a positive diff, I feel that subdiagnostics being able to use variables from their parent is very confusing, so this is for the better,. r? @jdonszelmann
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.
Tangentially related to #151366
This is PR 1/2 for structured diagnostics, will do the unstructured ones next. After the second PR I will be able to remove some code that should compensate for this PR being positive.
Regardless of this PR having a positive diff, I feel that subdiagnostics being able to use variables from their parent is very confusing, so this is for the better,.
r? @jdonszelmann