diff options
| author | Miguel Ojeda <ojeda@kernel.org> | 2021-02-24 05:48:44 +0100 |
|---|---|---|
| committer | Miguel Ojeda <ojeda@kernel.org> | 2021-02-24 06:13:42 +0100 |
| commit | eefec8abda7cb8e8693aa876fbd1e21f2a6a5c2d (patch) | |
| tree | 967ee057ebe74460adc39e7853d4ed4a9e23c47e /library/std/src/sys_common | |
| parent | fe1bf8e05c39bdcc73fc09e246b7209444e389bc (diff) | |
| download | rust-eefec8abda7cb8e8693aa876fbd1e21f2a6a5c2d.tar.gz rust-eefec8abda7cb8e8693aa876fbd1e21f2a6a5c2d.zip | |
library: Normalize safety-for-unsafe-block comments
Almost all safety comments are of the form `// SAFETY:`, so normalize the rest and fix a few of them that should have been a `/// # Safety` section instead. Furthermore, make `tidy` only allow the uppercase form. While currently `tidy` only checks `core`, it is a good idea to prevent `core` from drifting to non-uppercase comments, so that later we can start checking `alloc` etc. too. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'library/std/src/sys_common')
| -rw-r--r-- | library/std/src/sys_common/rwlock.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys_common/rwlock.rs b/library/std/src/sys_common/rwlock.rs index 41e8ad77294..70b31b19f82 100644 --- a/library/std/src/sys_common/rwlock.rs +++ b/library/std/src/sys_common/rwlock.rs @@ -103,7 +103,7 @@ impl StaticRWLock { /// The lock is automatically unlocked when the returned guard is dropped. #[inline] pub fn read_with_guard(&'static self) -> RWLockReadGuard { - // Safety: All methods require static references, therefore self + // SAFETY: All methods require static references, therefore self // cannot be moved between invocations. unsafe { self.0.read(); @@ -117,7 +117,7 @@ impl StaticRWLock { /// The lock is automatically unlocked when the returned guard is dropped. #[inline] pub fn write_with_guard(&'static self) -> RWLockWriteGuard { - // Safety: All methods require static references, therefore self + // SAFETY: All methods require static references, therefore self // cannot be moved between invocations. unsafe { self.0.write(); |
