@@ -2718,8 +2718,6 @@ impl<T: ?Sized> PartialOrd for *mut T {
27182718 (if you also use #[may_dangle]), Send, and/or Sync") ]
27192719#[ doc( hidden) ]
27202720#[ repr( transparent) ]
2721- // FIXME: the rustc_layout_scalar_valid_range_start attr is marked as unused
2722- #[ cfg_attr( stage0, allow( unused_attributes) ) ]
27232721#[ rustc_layout_scalar_valid_range_start( 1 ) ]
27242722pub struct Unique < T : ?Sized > {
27252723 pointer : * const T ,
@@ -2785,8 +2783,6 @@ impl<T: ?Sized> Unique<T> {
27852783 /// Creates a new `Unique` if `ptr` is non-null.
27862784 pub fn new ( ptr : * mut T ) -> Option < Self > {
27872785 if !ptr. is_null ( ) {
2788- // FIXME: this unsafe block is actually needed
2789- #[ cfg_attr( stage0, allow( unused_unsafe) ) ]
27902786 Some ( unsafe { Unique { pointer : ptr as _ , _marker : PhantomData } } )
27912787 } else {
27922788 None
@@ -2843,26 +2839,20 @@ impl<T: ?Sized> fmt::Pointer for Unique<T> {
28432839#[ unstable( feature = "ptr_internals" , issue = "0" ) ]
28442840impl < ' a , T : ?Sized > From < & ' a mut T > for Unique < T > {
28452841 fn from ( reference : & ' a mut T ) -> Self {
2846- // FIXME: this unsafe block is actually needed
2847- #[ cfg_attr( stage0, allow( unused_unsafe) ) ]
28482842 unsafe { Unique { pointer : reference as * mut T , _marker : PhantomData } }
28492843 }
28502844}
28512845
28522846#[ unstable( feature = "ptr_internals" , issue = "0" ) ]
28532847impl < ' a , T : ?Sized > From < & ' a T > for Unique < T > {
28542848 fn from ( reference : & ' a T ) -> Self {
2855- // FIXME: this unsafe block is actually needed
2856- #[ cfg_attr( stage0, allow( unused_unsafe) ) ]
28572849 unsafe { Unique { pointer : reference as * const T , _marker : PhantomData } }
28582850 }
28592851}
28602852
28612853#[ unstable( feature = "ptr_internals" , issue = "0" ) ]
28622854impl < ' a , T : ?Sized > From < NonNull < T > > for Unique < T > {
28632855 fn from ( p : NonNull < T > ) -> Self {
2864- // FIXME: this unsafe block is actually needed
2865- #[ cfg_attr( stage0, allow( unused_unsafe) ) ]
28662856 unsafe { Unique { pointer : p. pointer , _marker : PhantomData } }
28672857 }
28682858}
@@ -3052,8 +3042,6 @@ impl<T: ?Sized> hash::Hash for NonNull<T> {
30523042impl < T : ?Sized > From < Unique < T > > for NonNull < T > {
30533043 #[ inline]
30543044 fn from ( unique : Unique < T > ) -> Self {
3055- // FIXME: this unsafe block is actually needed
3056- #[ cfg_attr( stage0, allow( unused_unsafe) ) ]
30573045 unsafe { NonNull { pointer : unique. pointer } }
30583046 }
30593047}
@@ -3062,8 +3050,6 @@ impl<T: ?Sized> From<Unique<T>> for NonNull<T> {
30623050impl < ' a , T : ?Sized > From < & ' a mut T > for NonNull < T > {
30633051 #[ inline]
30643052 fn from ( reference : & ' a mut T ) -> Self {
3065- // FIXME: this unsafe block is actually needed
3066- #[ cfg_attr( stage0, allow( unused_unsafe) ) ]
30673053 unsafe { NonNull { pointer : reference as * mut T } }
30683054 }
30693055}
@@ -3072,8 +3058,6 @@ impl<'a, T: ?Sized> From<&'a mut T> for NonNull<T> {
30723058impl < ' a , T : ?Sized > From < & ' a T > for NonNull < T > {
30733059 #[ inline]
30743060 fn from ( reference : & ' a T ) -> Self {
3075- // FIXME: this unsafe block is actually needed
3076- #[ cfg_attr( stage0, allow( unused_unsafe) ) ]
30773061 unsafe { NonNull { pointer : reference as * const T } }
30783062 }
30793063}
0 commit comments