Skip to content

reorder safety comments and attributes#123

Merged
BennoLossin merged 1 commit intomainfrom
dev/old-clippy-safety-comment-fix
Mar 18, 2026
Merged

reorder safety comments and attributes#123
BennoLossin merged 1 commit intomainfrom
dev/old-clippy-safety-comment-fix

Conversation

@BennoLossin
Copy link
Member

This avoids clippy errors in old versions of clippy (here 1.78):

error: unsafe impl missing a safety comment
    --> src/lib.rs:1677:9
     |
1677 |         unsafe impl<$ret, $($rest),*> ZeroableOption for $($prefix)* fn($($rest),*) -> $ret {}
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1682 | impl_fn_zeroable_option!(["Rust", "C"] { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U });
     | --------------------------------------------------------------------------------------------------------- in this macro invocation
     |
     = help: consider adding a safety comment on the preceding line
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
     = note: this error originates in the macro `impl_fn_zeroable_option` (in Nightly builds, run with -Z macro-backtrace for more info)

Fixes: 530c4eb ("doc: de-clutter documentation with fake-variadics")

This avoids clippy errors in old versions of clippy (here 1.78):

    error: unsafe impl missing a safety comment
        --> src/lib.rs:1677:9
         |
    1677 |         unsafe impl<$ret, $($rest),*> ZeroableOption for $($prefix)* fn($($rest),*) -> $ret {}
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...
    1682 | impl_fn_zeroable_option!(["Rust", "C"] { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U });
         | --------------------------------------------------------------------------------------------------------- in this macro invocation
         |
         = help: consider adding a safety comment on the preceding line
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
         = note: this error originates in the macro `impl_fn_zeroable_option` (in Nightly builds, run with -Z macro-backtrace for more info)

Fixes: 530c4eb ("doc: de-clutter documentation with fake-variadics")
Signed-off-by: Benno Lossin <lossin@kernel.org>
@BennoLossin BennoLossin merged commit 36793ed into main Mar 18, 2026
26 checks passed
@BennoLossin BennoLossin deleted the dev/old-clippy-safety-comment-fix branch March 18, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant