File tree 6 files changed +8
-1
lines changed
6 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 89
89
// Lints:
90
90
#![ deny( rust_2021_incompatible_or_patterns) ]
91
91
#![ deny( unsafe_op_in_unsafe_fn) ]
92
+ #![ deny( fuzzy_provenance_casts) ]
92
93
#![ warn( deprecated_in_future) ]
93
94
#![ warn( missing_debug_implementations) ]
94
95
#![ warn( missing_docs) ]
162
163
#![ feature( slice_ptr_get) ]
163
164
#![ feature( slice_split_at_unchecked) ]
164
165
#![ feature( str_internals) ]
166
+ #![ feature( strict_provenance) ]
165
167
#![ feature( utf16_extra) ]
166
168
#![ feature( utf16_extra_const) ]
167
169
#![ feature( variant_count) ]
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ impl<T: ?Sized> *const T {
140
140
/// assert_eq!(<*const u8>::from_bits(1), dangling);
141
141
/// ```
142
142
#[ unstable( feature = "ptr_to_from_bits" , issue = "91126" ) ]
143
+ #[ allow( fuzzy_provenance_casts) ] // this is an unstable and semi-deprecated cast function
143
144
pub fn from_bits ( bits : usize ) -> Self
144
145
where
145
146
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 {
616
616
#[ inline]
617
617
#[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
618
618
#[ 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
619
620
pub fn from_exposed_addr < T > ( addr : usize ) -> * const T
620
621
where
621
622
T : Sized ,
@@ -653,6 +654,7 @@ where
653
654
#[ inline]
654
655
#[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
655
656
#[ 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
656
658
pub fn from_exposed_addr_mut < T > ( addr : usize ) -> * mut T
657
659
where
658
660
T : Sized ,
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ impl<T: ?Sized> *mut T {
146
146
/// assert_eq!(<*mut u8>::from_bits(1), dangling);
147
147
/// ```
148
148
#[ unstable( feature = "ptr_to_from_bits" , issue = "91126" ) ]
149
+ #[ allow( fuzzy_provenance_casts) ] // this is an unstable and semi-deprecated cast function
149
150
pub fn from_bits ( bits : usize ) -> Self
150
151
where
151
152
T : Sized ,
Original file line number Diff line number Diff line change 109
109
#![ feature( utf8_chunks) ]
110
110
#![ feature( is_ascii_octdigit) ]
111
111
#![ deny( unsafe_op_in_unsafe_fn) ]
112
+ #![ deny( fuzzy_provenance_casts) ]
112
113
113
114
extern crate test;
114
115
Original file line number Diff line number Diff line change @@ -677,7 +677,7 @@ fn align_offset_issue_103361() {
677
677
#[ cfg( target_pointer_width = "16" ) ]
678
678
const SIZE : usize = 1 << 13 ;
679
679
struct HugeSize ( [ u8 ; SIZE - 1 ] ) ;
680
- let _ = ( SIZE as * const HugeSize ) . align_offset ( SIZE ) ;
680
+ let _ = ptr :: invalid :: < HugeSize > ( SIZE ) . align_offset ( SIZE ) ;
681
681
}
682
682
683
683
#[ test]
You can’t perform that action at this time.
0 commit comments