-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc: Search all derives for inert attributes #52230
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
6dcf8e1
to
f8d67a9
Compare
src/librustc_resolve/macros.rs
Outdated
@@ -412,7 +428,7 @@ impl<'a> Resolver<'a> { | |||
attrs | |||
}); | |||
} | |||
return Err(Determinacy::Undetermined); |
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.
Hmm, I think the return was actually correct, but misplaced - we can return once we've found an inert attribute and processed it, we don't need to go through remaining traits and possibly repeat the process, so the return should go inside if inert_attrs.contains(&attr_name) { ... }
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 right yes indeed!
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.
should be updated now!
This commit fixes an apparent mistake in librustc_resolve where when the `proc_macro` feature is enabled (or `rust_2018_preview`) the resolution of custom attributes for custom derive was tweaked. Previously when an attribute failed to resolve it was attempted to locate if there is a custom derive also in scope which declares the attribute, but only the first custom derive directive was search. Instead this commit fixes the loop to search all custom derive invocations looking for any which register the attribute in question. Closes rust-lang#52219
f8d67a9
to
743a817
Compare
@bors r+ |
📌 Commit 743a817 has been approved by |
rustc: Search all derives for inert attributes This commit fixes an apparent mistake in librustc_resolve where when the `proc_macro` feature is enabled (or `rust_2018_preview`) the resolution of custom attributes for custom derive was tweaked. Previously when an attribute failed to resolve it was attempted to locate if there is a custom derive also in scope which declares the attribute, but only the first custom derive directive was search. Instead this commit fixes the loop to search all custom derive invocations looking for any which register the attribute in question. Closes #52219
☀️ Test successful - status-appveyor, status-travis |
This commit fixes an apparent mistake in librustc_resolve where when the
proc_macro
feature is enabled (orrust_2018_preview
) the resolution ofcustom attributes for custom derive was tweaked. Previously when an attribute
failed to resolve it was attempted to locate if there is a custom derive also in
scope which declares the attribute, but only the first custom derive directive
was search.
Instead this commit fixes the loop to search all custom derive invocations
looking for any which register the attribute in question.
Closes #52219