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 (undocumented_unsafe_blocks) #13316

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

Unsafe attributes support (undocumented_unsafe_blocks) #13316

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 in place.

Since undocumented_unsafe_blocks 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 #13317 as well.

Advantage

No response

Drawbacks

No response

Example

#[unsafe(no_mangle)]
pub fn f() {}

Should be written as:

// SAFETY: ...
#[unsafe(no_mangle)]
pub fn f() {}
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