Skip to content
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

Unsafe attributes support (unnecessary_safety_comment) #13317

Open
ojeda opened this issue Aug 28, 2024 · 0 comments
Open

Unsafe attributes support (unnecessary_safety_comment) #13317

ojeda opened this issue Aug 28, 2024 · 0 comments
Labels
A-lint Area: New lints

Comments

@ojeda
Copy link
Contributor

ojeda commented Aug 28, 2024

What it does

Unsafe attributes have been stabilized (rust-lang/rust#128771), thus it would be nice to have a lint that ensures // SAFETY comments are not written for safe attributes.

Since unnecessary_safety_comment covers impls too, perhaps it should also cover this too, although it may be best to possibly split them (but that is a different issue).

See #13316 as well.

Advantage

No response

Drawbacks

No response

Example

// SAFETY: ...
#[derive(Debug)]
struct S;

Should be written as:

#[derive(Debug)]
struct S;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

1 participant