Skip to content

Let HasAttrs return attributes for StmtKind::Item #43807

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

Closed
wants to merge 1 commit into from

Conversation

sinkuu
Copy link
Contributor

@sinkuu sinkuu commented Aug 11, 2017

Fixes HasAttrs ignoring attributes from item statements.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@shepmaster
Copy link
Member

Thanks @sinkuu! Since Niko is out for vacation, let's see what @eddyb has to say!

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned nikomatsakis Aug 11, 2017
@shepmaster shepmaster added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2017
@eddyb
Copy link
Member

eddyb commented Aug 12, 2017

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 12, 2017

📌 Commit 5e7dc36 has been approved by eddyb

@eddyb
Copy link
Member

eddyb commented Aug 12, 2017

@bors r- Wait, I may know why this is so.

@@ -1291,7 +1291,7 @@ impl HasAttrs for StmtKind {
fn attrs(&self) -> &[Attribute] {
match *self {
StmtKind::Local(ref local) => local.attrs(),
StmtKind::Item(..) => &[],
StmtKind::Item(ref item) => item.attrs(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this "fixing"? It may be the case that this change will result in the same attributes being seen twice.
Although it's in libsyntax. Where it might not even be used directly.

@eddyb
Copy link
Member

eddyb commented Aug 12, 2017

r? @jseyfried

@rust-highfive rust-highfive assigned jseyfried and unassigned eddyb Aug 12, 2017
@sinkuu sinkuu changed the title Fix HasAttrs for StmtKind::Item Let HasAttrs return attributes for StmtKind::Item Aug 12, 2017
@sinkuu
Copy link
Contributor Author

sinkuu commented Aug 12, 2017

I should have checked git history: b968ee3
Sorry for the trouble.

@sinkuu sinkuu closed this Aug 12, 2017
@sinkuu sinkuu deleted the hasattrs_item branch August 12, 2017 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants