Fix non-module parent_module in stripped cfg diagnostics#153959
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Mar 17, 2026
Merged
Fix non-module parent_module in stripped cfg diagnostics#153959rust-bors[bot] merged 2 commits intorust-lang:mainfrom
parent_module in stripped cfg diagnostics#153959rust-bors[bot] merged 2 commits intorust-lang:mainfrom
Conversation
Collaborator
|
Some changes occurred in compiler/rustc_hir/src/attrs |
Collaborator
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
Author
|
r? petrochenkov |
parent_module in stripped cfg diagnosticsStrippedCfgItem.parent_module to the nearest module
Contributor
Author
|
@rustbot review |
StrippedCfgItem.parent_module to the nearest moduleparent_module in stripped cfg diagnostics
Contributor
Author
|
@rustbot ready |
Contributor
|
Thanks! |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 17, 2026
…rochenkov Fix non-module `parent_module` in stripped cfg diagnostics Fixes rust-lang#153848 Old `parent_module` is from the `parent_node` in `append_stripped_cfg_item`, it cannot be assumed that it points to a real module. So call `expect_module` on it will cause ICE. The first commit rename `parent_module` to `parent_scope`, and the second using `get_nearest_non_block_module` to find the nearest `module` of `parent_scope` in `find_cfg_stripped`, which should be the correct `parent_module`.
This was referenced Mar 17, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 17, 2026
…uwer Rollup of 14 pull requests Successful merges: - #153972 (stdarch subtree update) - #153801 (Add the option to run UI tests with the parallel frontend) - #153959 (Fix non-module `parent_module` in stripped cfg diagnostics) - #153967 (Tweak wording of failed predicate in inference error) - #152968 (Flip "region lattice" in RegionKind doc comment) - #153531 (Fix LegacyKeyValueFormat report from docker build: various) - #153622 (remove concept of soft-unstable features) - #153709 (Fix hypothetical ICE in `variances_of`) - #153884 (test `classify-runtime-const` for `f16`) - #153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding) - #153920 (improve `#[track_caller]` invalid ABI error) - #153946 (dissolve `tests/ui/cross`) - #153965 (Fix minor kasan bugs) - #153991 (Small report_cycle refactor)
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Mar 18, 2026
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#153972 (stdarch subtree update) - rust-lang/rust#153801 (Add the option to run UI tests with the parallel frontend) - rust-lang/rust#153959 (Fix non-module `parent_module` in stripped cfg diagnostics) - rust-lang/rust#153967 (Tweak wording of failed predicate in inference error) - rust-lang/rust#152968 (Flip "region lattice" in RegionKind doc comment) - rust-lang/rust#153531 (Fix LegacyKeyValueFormat report from docker build: various) - rust-lang/rust#153622 (remove concept of soft-unstable features) - rust-lang/rust#153709 (Fix hypothetical ICE in `variances_of`) - rust-lang/rust#153884 (test `classify-runtime-const` for `f16`) - rust-lang/rust#153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding) - rust-lang/rust#153920 (improve `#[track_caller]` invalid ABI error) - rust-lang/rust#153946 (dissolve `tests/ui/cross`) - rust-lang/rust#153965 (Fix minor kasan bugs) - rust-lang/rust#153991 (Small report_cycle refactor)
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Mar 18, 2026
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#153972 (stdarch subtree update) - rust-lang/rust#153801 (Add the option to run UI tests with the parallel frontend) - rust-lang/rust#153959 (Fix non-module `parent_module` in stripped cfg diagnostics) - rust-lang/rust#153967 (Tweak wording of failed predicate in inference error) - rust-lang/rust#152968 (Flip "region lattice" in RegionKind doc comment) - rust-lang/rust#153531 (Fix LegacyKeyValueFormat report from docker build: various) - rust-lang/rust#153622 (remove concept of soft-unstable features) - rust-lang/rust#153709 (Fix hypothetical ICE in `variances_of`) - rust-lang/rust#153884 (test `classify-runtime-const` for `f16`) - rust-lang/rust#153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding) - rust-lang/rust#153920 (improve `#[track_caller]` invalid ABI error) - rust-lang/rust#153946 (dissolve `tests/ui/cross`) - rust-lang/rust#153965 (Fix minor kasan bugs) - rust-lang/rust#153991 (Small report_cycle refactor)
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.
Fixes #153848
Old
parent_moduleis from theparent_nodeinappend_stripped_cfg_item, it cannot be assumed that it points to a real module. So callexpect_moduleon it will cause ICE.The first commit rename
parent_moduletoparent_scope, and the second usingget_nearest_non_block_moduleto find the nearestmoduleofparent_scopeinfind_cfg_stripped, which should be the correctparent_module.