@@ -23,6 +23,7 @@ use core::char;
2323use core:: ffi:: c_void;
2424use core:: marker;
2525use core:: mem;
26+ use core:: ptr;
2627use core:: slice;
2728
2829// Store an OsString on std so we can provide the symbol name and filename.
@@ -44,7 +45,7 @@ impl Symbol<'_> {
4445 }
4546
4647 pub fn addr ( & self ) -> Option < * mut c_void > {
47- Some ( self . addr as * mut _ )
48+ Some ( self . addr )
4849 }
4950
5051 pub fn filename_raw ( & self ) -> Option < BytesOrWideString < ' _ > > {
@@ -184,8 +185,7 @@ unsafe fn do_resolve(
184185) {
185186 const SIZE : usize = 2 * MAX_SYM_NAME + mem:: size_of :: < SYMBOL_INFOW > ( ) ;
186187 let mut data = Aligned8 ( [ 0u8 ; SIZE ] ) ;
187- let data = & mut data. 0 ;
188- let info = & mut * ( data. as_mut_ptr ( ) as * mut SYMBOL_INFOW ) ;
188+ let info = & mut * data. 0 . as_mut_ptr ( ) . cast :: < SYMBOL_INFOW > ( ) ;
189189 info. MaxNameLen = MAX_SYM_NAME as ULONG ;
190190 // the struct size in C. the value is different to
191191 // `size_of::<SYMBOL_INFOW>() - MAX_SYM_NAME + 1` (== 81)
@@ -200,7 +200,7 @@ unsafe fn do_resolve(
200200 // give a buffer of (MaxNameLen - 1) characters and set NameLen to
201201 // the real value.
202202 let name_len = :: core:: cmp:: min ( info. NameLen as usize , info. MaxNameLen as usize - 1 ) ;
203- let name_ptr = info. Name . as_ptr ( ) as * const u16 ;
203+ let name_ptr = info. Name . as_ptr ( ) . cast :: < u16 > ( ) ;
204204 let name = slice:: from_raw_parts ( name_ptr, name_len) ;
205205
206206 // Reencode the utf-16 symbol to utf-8 so we can use `SymbolName::new` like
@@ -222,7 +222,7 @@ unsafe fn do_resolve(
222222 }
223223 }
224224 }
225- let name = & name_buffer[ ..name_len] as * const [ u8 ] ;
225+ let name = ptr :: addr_of! ( name_buffer[ ..name_len] ) ;
226226
227227 let mut line = mem:: zeroed :: < IMAGEHLP_LINEW64 > ( ) ;
228228 line. SizeOfStruct = mem:: size_of :: < IMAGEHLP_LINEW64 > ( ) as DWORD ;
@@ -240,7 +240,7 @@ unsafe fn do_resolve(
240240
241241 let len = len as usize ;
242242
243- filename = Some ( slice:: from_raw_parts ( base, len) as * const [ u16 ] ) ;
243+ filename = Some ( ptr :: from_ref ( slice:: from_raw_parts ( base, len) ) ) ;
244244 }
245245
246246 cb ( & super :: Symbol {
0 commit comments