1
Fork 0

Capitalize safety comments

This commit is contained in:
Flying-Toast 2020-09-08 22:37:18 -04:00
parent c66789d572
commit 2799aec6ab
4 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ pub struct MaybeTempDir {
impl Drop for MaybeTempDir { impl Drop for MaybeTempDir {
fn drop(&mut self) { fn drop(&mut self) {
// Safety: We are in the destructor, and no further access will // SAFETY: We are in the destructor, and no further access will
// occur. // occur.
let dir = unsafe { ManuallyDrop::take(&mut self.dir) }; let dir = unsafe { ManuallyDrop::take(&mut self.dir) };
if self.keep { if self.keep {

View file

@ -157,7 +157,7 @@ impl Global {
} }
} }
// Safety: Same as `AllocRef::grow` // SAFETY: Same as `AllocRef::grow`
#[inline] #[inline]
unsafe fn grow_impl( unsafe fn grow_impl(
&mut self, &mut self,

View file

@ -2392,7 +2392,7 @@ impl<T> VecDeque<T> {
} }
} }
// Safety: the following two methods require that the rotation amount // SAFETY: the following two methods require that the rotation amount
// be less than half the length of the deque. // be less than half the length of the deque.
// //
// `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`, // `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`,

View file

@ -12,7 +12,7 @@ fn main() {
yield; yield;
assert_eq!(b as *const _, &a as *const _); assert_eq!(b as *const _, &a as *const _);
}; };
// Safety: We shadow the original generator variable so have no safe API to // SAFETY: We shadow the original generator variable so have no safe API to
// move it after this point. // move it after this point.
let mut generator = unsafe { Pin::new_unchecked(&mut generator) }; let mut generator = unsafe { Pin::new_unchecked(&mut generator) };
assert_eq!(generator.as_mut().resume(()), GeneratorState::Yielded(())); assert_eq!(generator.as_mut().resume(()), GeneratorState::Yielded(()));