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

Tracking issue for inclusion of `derive` in lint `unused_attributes` #54651

Open
Havvy opened this Issue Sep 28, 2018 · 6 comments

Comments

Projects
None yet
6 participants
@Havvy
Contributor

Havvy commented Sep 28, 2018

The following code emits an unsquelchable warning.

#![crate_type="lib"]

#[derive()]
struct Struct;
warning: empty trait list in `derive`
 --> src/lib.rs:4:1
  |
4 | #[derive()]
  | ^^^^^^^^^^^

This warning should have a named lint unused_derive that is a part of the unused group of lints.

This warning should be a part of unused_attributes.

@petrochenkov

This comment has been minimized.

Show comment
Hide comment
@petrochenkov

petrochenkov Sep 28, 2018

Contributor

empty trait list in derive should have a lint name

... and that name is unused_attributes.

Contributor

petrochenkov commented Sep 28, 2018

empty trait list in derive should have a lint name

... and that name is unused_attributes.

@clintfred

This comment has been minimized.

Show comment
Hide comment
@clintfred

clintfred Sep 28, 2018

#[allow(unused_attributes)]
#[derive()]

Does not appear to squelch the warning for me...

clintfred commented Sep 28, 2018

#[allow(unused_attributes)]
#[derive()]

Does not appear to squelch the warning for me...

@Centril Centril added the T-lang label Sep 29, 2018

@Centril Centril changed the title from warning: empty trait list in `derive` should have a lint name to Tracking issue for inclusion of `derive` in lint `unused_attributes` Sep 29, 2018

@Centril

This comment has been minimized.

Show comment
Hide comment
@Centril

Centril Sep 29, 2018

Contributor

It seems eminently reasonable to me to include #[derive()] in unused_attributes since it is an attribute applied with no effect; so let's kick off fcp for that.

@rfcbot merge

Contributor

Centril commented Sep 29, 2018

It seems eminently reasonable to me to include #[derive()] in unused_attributes since it is an attribute applied with no effect; so let's kick off fcp for that.

@rfcbot merge

@rfcbot

This comment has been minimized.

Show comment
Hide comment
@rfcbot

rfcbot Sep 29, 2018

Team member @Centril has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

rfcbot commented Sep 29, 2018

Team member @Centril has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@zackmdavis

This comment has been minimized.

Show comment
Hide comment
@zackmdavis

zackmdavis Sep 29, 2018

Member

Implementing this as part of the existing UnusedAttributes pass would be complicated by #45216, but it might also be possible to implement where the existing "empty trait list" warning is issued (possibly as a buffered early lint).

Member

zackmdavis commented Sep 29, 2018

Implementing this as part of the existing UnusedAttributes pass would be complicated by #45216, but it might also be possible to implement where the existing "empty trait list" warning is issued (possibly as a buffered early lint).

@Havvy

This comment has been minimized.

Show comment
Hide comment
@Havvy

Havvy Sep 29, 2018

Contributor

I need to make UnusedAttributes a buffered early lint for the same thing with cfg_attr.

Contributor

Havvy commented Sep 29, 2018

I need to make UnusedAttributes a buffered early lint for the same thing with cfg_attr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment