File tree 3 files changed +7
-4
lines changed
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 220
220
#![ allow( explicit_outlives_requirements) ]
221
221
#![ allow( unused_lifetimes) ]
222
222
#![ deny( rustc:: existing_doc_keyword) ]
223
+ #![ deny( fuzzy_provenance_casts) ]
223
224
// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
224
225
#![ deny( ffi_unwind_calls) ]
225
226
// std may use features in a platform-specific way
@@ -597,7 +598,7 @@ mod panicking;
597
598
mod personality;
598
599
599
600
#[ path = "../../backtrace/src/lib.rs" ]
600
- #[ allow( dead_code, unused_attributes) ]
601
+ #[ allow( dead_code, unused_attributes, fuzzy_provenance_casts ) ]
601
602
mod backtrace_rs;
602
603
603
604
// Re-export macros defined in libcore.
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ impl OwnedSocket {
90
90
}
91
91
92
92
// FIXME(strict_provenance_magic): we defined RawSocket to be a u64 ;-;
93
+ #[ allow( fuzzy_provenance_casts) ]
93
94
#[ cfg( not( target_vendor = "uwp" ) ) ]
94
95
pub ( crate ) fn set_no_inherit ( & self ) -> io:: Result < ( ) > {
95
96
cvt ( unsafe {
Original file line number Diff line number Diff line change 13
13
14
14
use super :: DwarfReader ;
15
15
use core:: mem;
16
+ use core:: ptr;
16
17
17
18
pub const DW_EH_PE_omit : u8 = 0xFF ;
18
19
pub const DW_EH_PE_absptr : u8 = 0x00 ;
@@ -151,7 +152,7 @@ unsafe fn read_encoded_pointer(
151
152
152
153
// DW_EH_PE_aligned implies it's an absolute pointer value
153
154
if encoding == DW_EH_PE_aligned {
154
- reader. ptr = round_up ( reader. ptr as usize , mem:: size_of :: < usize > ( ) ) ? as * const u8 ;
155
+ reader. ptr = reader . ptr . with_addr ( round_up ( reader. ptr . addr ( ) , mem:: size_of :: < usize > ( ) ) ?) ;
155
156
return Ok ( reader. read :: < usize > ( ) ) ;
156
157
}
157
158
@@ -171,7 +172,7 @@ unsafe fn read_encoded_pointer(
171
172
result += match encoding & 0x70 {
172
173
DW_EH_PE_absptr => 0 ,
173
174
// relative to address of the encoded value, despite the name
174
- DW_EH_PE_pcrel => reader. ptr as usize ,
175
+ DW_EH_PE_pcrel => reader. ptr . expose_addr ( ) ,
175
176
DW_EH_PE_funcrel => {
176
177
if context. func_start == 0 {
177
178
return Err ( ( ) ) ;
@@ -184,7 +185,7 @@ unsafe fn read_encoded_pointer(
184
185
} ;
185
186
186
187
if encoding & DW_EH_PE_indirect != 0 {
187
- result = * ( result as * const usize ) ;
188
+ result = * ptr :: from_exposed_addr :: < usize > ( result) ;
188
189
}
189
190
190
191
Ok ( result)
You can’t perform that action at this time.
0 commit comments