-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve: Do not afraid to set current module to enums and traits #64177
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Interesting. |
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with comment addressed
@@ -1640,7 +1644,7 @@ impl<'a> Resolver<'a> { | |||
} | |||
|
|||
if let ModuleKind::Block(..) = module.kind { | |||
return Some(module.parent.unwrap()); | |||
return Some(module.parent.unwrap().nearest_item_scope()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks like it's not doing anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fixes the CI failure above (minimized in block-with-trait-parent.rs
).
If the block is directly inside a trait item, then its parent is the trait and we need to skip it and jump to the trait's parent module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, I missed that this was using the parent module.
@bors r+ |
📌 Commit 56f6353 has been approved by |
resolve: Do not afraid to set current module to enums and traits After rust-lang@cfbb60b it's ok. This is likely required for rust-lang#63468 to work correctly, because that PR starts resolving attributes on enum variants. r? @matthewjasper @c410-f3r
Rollup of 5 pull requests Successful merges: - #64052 (Rename test locals to work around LLDB bug) - #64066 (Support "soft" feature-gating using a lint) - #64177 (resolve: Do not afraid to set current module to enums and traits) - #64229 (Reduce span to function name in unreachable calls) - #64255 (Add methods for converting `bool` to `Option<T>`) Failed merges: r? @ghost
☔ The latest upstream changes (presumably #64269) made this pull request unmergeable. Please resolve the merge conflicts. |
After cfbb60b it's ok.
This is likely required for #63468 to work correctly, because that PR starts resolving attributes on enum variants.
r? @matthewjasper @c410-f3r