-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Don't assume plugin-whitelisted attributes are proc macro attributes #40039
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
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
r? @jseyfried |
Excellent, thanks! |
📌 Commit 0bf59b5 has been approved by |
src/librustc_resolve/macros.rs
Outdated
@@ -181,6 +181,11 @@ impl<'a> base::Resolver for Resolver<'a> { | |||
fn find_legacy_attr_invoc(&mut self, attrs: &mut Vec<ast::Attribute>) | |||
-> Option<ast::Attribute> { | |||
for i in 0..attrs.len() { | |||
if self.session.plugin_attributes.borrow().iter() | |||
.any(|&(ref attr_nm, _)| attrs[i].check_name(attr_nm)) { |
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.
check_name
marks the attribute as used when it returns true
, which is breaking plugin-attr-register-deny.rs
on Travis.
I would use attrs[i].name() == attr_nm
instead.
✌️ @abonander can now approve this pull request |
0bf59b5
to
e5d4585
Compare
b158944
to
dac25e2
Compare
@bors r=jseyfried |
📌 Commit dac25e2 has been approved by |
@Manishearth Could this get a p=1? |
@bors p=1 |
Don't assume plugin-whitelisted attributes are proc macro attributes closes #40001
☀️ Test successful - status-appveyor, status-travis |
Make #[dom_struct] a proc_macro attribute The rustup is needed for rust-lang/rust#40039. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15715) <!-- Reviewable:end -->
… nox:custom-derive); r=SimonSapin The rustup is needed for rust-lang/rust#40039. Source-Repo: https://github.com/servo/servo Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba --HG-- rename : servo/components/domobject_derive/Cargo.toml => servo/components/dom_struct/Cargo.toml extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 2cad140c3d6b99837f0bd15a6f3ccba0f353e049
… nox:custom-derive); r=SimonSapin The rustup is needed for rust-lang/rust#40039. Source-Repo: https://github.com/servo/servo Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba
… nox:custom-derive); r=SimonSapin The rustup is needed for rust-lang/rust#40039. Source-Repo: https://github.com/servo/servo Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba
… nox:custom-derive); r=SimonSapin The rustup is needed for rust-lang/rust#40039. Source-Repo: https://github.com/servo/servo Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba UltraBlame original commit: b439aae221f2298caa3f41781ce3dfbd0b36d8ad
… nox:custom-derive); r=SimonSapin The rustup is needed for rust-lang/rust#40039. Source-Repo: https://github.com/servo/servo Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba UltraBlame original commit: b439aae221f2298caa3f41781ce3dfbd0b36d8ad
… nox:custom-derive); r=SimonSapin The rustup is needed for rust-lang/rust#40039. Source-Repo: https://github.com/servo/servo Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba UltraBlame original commit: b439aae221f2298caa3f41781ce3dfbd0b36d8ad
closes #40001