Skip to content

Commit

Permalink
Capitalize safety comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Flying-Toast committed Sep 9, 2020
1 parent c66789d commit 2799aec
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/temp_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct MaybeTempDir {

impl Drop for MaybeTempDir {
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.
let dir = unsafe { ManuallyDrop::take(&mut self.dir) };
if self.keep {
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl Global {
}
}

// Safety: Same as `AllocRef::grow`
// SAFETY: Same as `AllocRef::grow`
#[inline]
unsafe fn grow_impl(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
// `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`,
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generator/static-generators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {
yield;
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.
let mut generator = unsafe { Pin::new_unchecked(&mut generator) };
assert_eq!(generator.as_mut().resume(()), GeneratorState::Yielded(()));
Expand Down

0 comments on commit 2799aec

Please sign in to comment.