Repository navigation
Add lint for wrong attributes - #10316
Conversation
There was a problem hiding this comment.
This may also want to include
no_implicit_preludelicense
There was a problem hiding this comment.
no_implicit_prelude can be used on items:
#[no_implicit_prelude]
mod x {
fn f() -> Option<int> { None } // error: use of undeclared type name `Option`
}
I initially included license, copyright and comment but I've found we don't use them at all, so I don't know how good including them is.
There was a problem hiding this comment.
They're not explicitly used anywhere currently, but all crate attributes contribute to the crate hash currently (but that may not stick around very long).
There was a problem hiding this comment.
It's probably fine to leave them out for now.
|
@klutzy any progress on this? |
|
I've completely forgot this! I've implemented unknown-attr lint but haven't added tests yet. It also needs update to reflect current attributes. |
|
I think it's done. r? |
|
@klutzy needs rebase |
This also moves `#[auto_{en,de}code]` checker from syntax to lint.
This also enables two tests properly.
|
rebase done. |
This patchset makes warning if crate-level attribute is used at other places, obsolete attributed is used, or unknown attribute is used, since they are usually from mistakes. Closes #3348
…lang/rust#10316. Also moved comment attr to desc which seems more appropriate.
… r=Manishearth Add `suspicious_command_arg_space` lint Fixes rust-lang#10316 --- changelog: New lint: [`suspicious_command_arg_space`] [rust-lang#10317](rust-lang/rust-clippy#10317) <!-- changelog_checked -->
This patchset makes warning if crate-level attribute is used at other places, obsolete attributed is used, or unknown attribute is used, since they are usually from mistakes.
Closes #3348