Skip to content

Commit a1623ff

Browse files
Deny unsafe ops in unsafe fns, part 6
And final part!!!
1 parent b365233 commit a1623ff

File tree

25 files changed

+185
-93
lines changed

25 files changed

+185
-93
lines changed

src/libcore/alloc/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Memory allocation APIs
22
33
#![stable(feature = "alloc_module", since = "1.28.0")]
4-
#![deny(unsafe_op_in_unsafe_fn)]
54

65
mod global;
76
mod layout;

src/libcore/cell.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@
187187
//!
188188
189189
#![stable(feature = "rust1", since = "1.0.0")]
190-
#![deny(unsafe_op_in_unsafe_fn)]
191190

192191
use crate::cmp::Ordering;
193192
use crate::fmt::{self, Debug, Display};

src/libcore/char/convert.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Character conversions.
22
3-
#![deny(unsafe_op_in_unsafe_fn)]
4-
53
use crate::convert::TryFrom;
64
use crate::fmt;
75
use crate::mem::transmute;

src/libcore/char/methods.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! impl char {}
22
3-
#![deny(unsafe_op_in_unsafe_fn)]
4-
53
use crate::slice;
64
use crate::str::from_utf8_unchecked_mut;
75
use crate::unicode::printable::is_printable;

src/libcore/convert/num.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![deny(unsafe_op_in_unsafe_fn)]
2-
31
use super::{From, TryFrom};
42
use crate::num::TryFromIntError;
53

src/libcore/ffi.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![stable(feature = "", since = "1.30.0")]
22
#![allow(non_camel_case_types)]
3-
#![deny(unsafe_op_in_unsafe_fn)]
43

54
//! Utilities related to FFI bindings.
65

src/libcore/future/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,7 @@ where
8585
#[unstable(feature = "gen_future", issue = "50547")]
8686
#[inline]
8787
pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> {
88-
&mut *cx.0.as_ptr().cast()
88+
// SAFETY: the caller must guarantee that `cx.0` is a valid pointer
89+
// that fulfills all the requirements for a mutable reference.
90+
unsafe { &mut *cx.0.as_ptr().cast() }
8991
}

src/libcore/hash/sip.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! An implementation of SipHash.
22
33
#![allow(deprecated)] // the types in this module are deprecated
4-
#![deny(unsafe_op_in_unsafe_fn)]
54

65
use crate::cmp;
76
use crate::marker::PhantomData;

src/libcore/hint.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
//! Hints to compiler that affects how code should be emitted or optimized.
44
5-
#![deny(unsafe_op_in_unsafe_fn)]
6-
75
use crate::intrinsics;
86

97
/// Informs the compiler that this point in the code is not reachable, enabling

src/libcore/intrinsics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
issue = "none"
5454
)]
5555
#![allow(missing_docs)]
56-
#![deny(unsafe_op_in_unsafe_fn)]
5756

5857
use crate::marker::DiscriminantKind;
5958
use crate::mem;

0 commit comments

Comments
 (0)