Description
Currently the code block
// SAFETY: RwLockReadGuards act as immutable references, they follow the same rules as them. (see
// core::marker::Sync)
unsafe impl<T: ?Sized + Sync> Sync for RwLockReadGuard<'_, T> {}
unsafe impl<T: ?Sized + Sync> Send for RwLockReadGuard<'_, T> {}
triggers the lint undocumented_unsafe_block for the second unsafe impl.
I would prefer there was an option to allow for the safety comment to count as documenting all the consecutive unsafe impls with a break on an empty line.
Version
rustc 1.98.0-nightly (9e2abe0c6 2026-06-16)
binary: rustc
commit-hash: 9e2abe0c6ab27fcbb95c30695188a75776e2feb1
commit-date: 2026-06-16
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.7
Additional Labels
@rustbot label +C-enhancement
Description
Currently the code block
triggers the lint
undocumented_unsafe_blockfor the second unsafe impl.I would prefer there was an option to allow for the safety comment to count as documenting all the consecutive unsafe impls with a break on an empty line.
Version
Additional Labels
@rustbot label +C-enhancement