This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 220220#![ allow( explicit_outlives_requirements) ]
221221#![ allow( unused_lifetimes) ]
222222#![ deny( rustc:: existing_doc_keyword) ]
223+ #![ deny( fuzzy_provenance_casts) ]
223224// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
224225#![ deny( ffi_unwind_calls) ]
225226// std may use features in a platform-specific way
@@ -597,7 +598,7 @@ mod panicking;
597598mod personality;
598599
599600#[ path = "../../backtrace/src/lib.rs" ]
600- #[ allow( dead_code, unused_attributes) ]
601+ #[ allow( dead_code, unused_attributes, fuzzy_provenance_casts ) ]
601602mod backtrace_rs;
602603
603604// Re-export macros defined in libcore.
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ impl OwnedSocket {
9090 }
9191
9292 // FIXME(strict_provenance_magic): we defined RawSocket to be a u64 ;-;
93+ #[ allow( fuzzy_provenance_casts) ]
9394 #[ cfg( not( target_vendor = "uwp" ) ) ]
9495 pub ( crate ) fn set_no_inherit ( & self ) -> io:: Result < ( ) > {
9596 cvt ( unsafe {
Original file line number Diff line number Diff line change 1313
1414use super :: DwarfReader ;
1515use core:: mem;
16+ use core:: ptr;
1617
1718pub const DW_EH_PE_omit : u8 = 0xFF ;
1819pub const DW_EH_PE_absptr : u8 = 0x00 ;
@@ -151,7 +152,7 @@ unsafe fn read_encoded_pointer(
151152
152153 // DW_EH_PE_aligned implies it's an absolute pointer value
153154 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 > ( ) ) ?) ;
155156 return Ok ( reader. read :: < usize > ( ) ) ;
156157 }
157158
@@ -171,7 +172,7 @@ unsafe fn read_encoded_pointer(
171172 result += match encoding & 0x70 {
172173 DW_EH_PE_absptr => 0 ,
173174 // 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 ( ) ,
175176 DW_EH_PE_funcrel => {
176177 if context. func_start == 0 {
177178 return Err ( ( ) ) ;
@@ -184,7 +185,7 @@ unsafe fn read_encoded_pointer(
184185 } ;
185186
186187 if encoding & DW_EH_PE_indirect != 0 {
187- result = * ( result as * const usize ) ;
188+ result = * ptr :: from_exposed_addr :: < usize > ( result) ;
188189 }
189190
190191 Ok ( result)
You can’t perform that action at this time.
0 commit comments