Skip to content

Document unsafe in libcore #66506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Fix typos
  • Loading branch information
foeb committed Nov 18, 2019
commit edeaf2fbca956fb35422f917b8145d30b58ca714
2 changes: 1 addition & 1 deletion src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ impl<T: ?Sized> Cell<T> {
#[inline]
#[stable(feature = "cell_get_mut", since = "1.11.0")]
pub fn get_mut(&mut self) -> &mut T {
// SAFETY: not threadsafe, but it's OK since we know C`ell` isn't threadsafe
// SAFETY: not threadsafe, but it's OK since we know `Cell` isn't threadsafe
unsafe {
&mut *self.value.get()
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ impl<'a, P: Pattern<'a>> SplitInternal<'a, P> {
self.end = a;
Some(elt)
},
// SAFETY: `self.start` and `self.end` always lie on unicode boudaries
// SAFETY: `self.start` and `self.end` always lie on unicode boundaries
None => unsafe {
self.finished = true;
Some(haystack.get_unchecked(self.start..self.end))
Expand Down