File tree Expand file tree Collapse file tree 6 files changed +8
-1
lines changed Expand file tree Collapse file tree 6 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 8989// Lints:
9090#![ deny( rust_2021_incompatible_or_patterns) ]
9191#![ deny( unsafe_op_in_unsafe_fn) ]
92+ #![ deny( fuzzy_provenance_casts) ]
9293#![ warn( deprecated_in_future) ]
9394#![ warn( missing_debug_implementations) ]
9495#![ warn( missing_docs) ]
162163#![ feature( slice_ptr_get) ]
163164#![ feature( slice_split_at_unchecked) ]
164165#![ feature( str_internals) ]
166+ #![ feature( strict_provenance) ]
165167#![ feature( utf16_extra) ]
166168#![ feature( utf16_extra_const) ]
167169#![ feature( variant_count) ]
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ impl<T: ?Sized> *const T {
140140 /// assert_eq!(<*const u8>::from_bits(1), dangling);
141141 /// ```
142142 #[ unstable( feature = "ptr_to_from_bits" , issue = "91126" ) ]
143+ #[ allow( fuzzy_provenance_casts) ] // this is an unstable and semi-deprecated cast function
143144 pub fn from_bits ( bits : usize ) -> Self
144145 where
145146 T : Sized ,
Original file line number Diff line number Diff line change @@ -616,6 +616,7 @@ pub const fn invalid_mut<T>(addr: usize) -> *mut T {
616616#[ inline]
617617#[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
618618#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
619+ #[ allow( fuzzy_provenance_casts) ] // this *is* the strict provenance API one should use instead
619620pub fn from_exposed_addr < T > ( addr : usize ) -> * const T
620621where
621622 T : Sized ,
@@ -653,6 +654,7 @@ where
653654#[ inline]
654655#[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
655656#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
657+ #[ allow( fuzzy_provenance_casts) ] // this *is* the strict provenance API one should use instead
656658pub fn from_exposed_addr_mut < T > ( addr : usize ) -> * mut T
657659where
658660 T : Sized ,
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ impl<T: ?Sized> *mut T {
146146 /// assert_eq!(<*mut u8>::from_bits(1), dangling);
147147 /// ```
148148 #[ unstable( feature = "ptr_to_from_bits" , issue = "91126" ) ]
149+ #[ allow( fuzzy_provenance_casts) ] // this is an unstable and semi-deprecated cast function
149150 pub fn from_bits ( bits : usize ) -> Self
150151 where
151152 T : Sized ,
Original file line number Diff line number Diff line change 109109#![ feature( utf8_chunks) ]
110110#![ feature( is_ascii_octdigit) ]
111111#![ deny( unsafe_op_in_unsafe_fn) ]
112+ #![ deny( fuzzy_provenance_casts) ]
112113
113114extern crate test;
114115
Original file line number Diff line number Diff line change @@ -677,7 +677,7 @@ fn align_offset_issue_103361() {
677677 #[ cfg( target_pointer_width = "16" ) ]
678678 const SIZE : usize = 1 << 13 ;
679679 struct HugeSize ( [ u8 ; SIZE - 1 ] ) ;
680- let _ = ( SIZE as * const HugeSize ) . align_offset ( SIZE ) ;
680+ let _ = ptr :: invalid :: < HugeSize > ( SIZE ) . align_offset ( SIZE ) ;
681681}
682682
683683#[ test]
You can’t perform that action at this time.
0 commit comments