11use backtrace:: Backtrace ;
2+ use core:: ffi:: c_void;
23
34// This test only works on platforms which have a working `symbol_address`
45// function for frames which reports the starting address of a symbol. As a
@@ -12,6 +13,7 @@ const ENABLED: bool = cfg!(all(
1213) ) ;
1314
1415#[ test]
16+ #[ inline( never) ]
1517fn backtrace_new_unresolved_should_start_with_call_site_trace ( ) {
1618 if !ENABLED {
1719 return ;
@@ -22,13 +24,14 @@ fn backtrace_new_unresolved_should_start_with_call_site_trace() {
2224
2325 assert ! ( !b. frames( ) . is_empty( ) ) ;
2426
25- let this_ip = backtrace_new_unresolved_should_start_with_call_site_trace as usize ;
26- println ! ( "this_ip: {:? }" , this_ip as * const usize ) ;
27- let frame_ip = b. frames ( ) . first ( ) . unwrap ( ) . symbol_address ( ) as usize ;
27+ let this_ip = backtrace_new_unresolved_should_start_with_call_site_trace as * mut c_void ;
28+ println ! ( "this_ip: {:p }" , this_ip) ;
29+ let frame_ip = b. frames ( ) . first ( ) . unwrap ( ) . symbol_address ( ) ;
2830 assert_eq ! ( this_ip, frame_ip) ;
2931}
3032
3133#[ test]
34+ #[ inline( never) ]
3235fn backtrace_new_should_start_with_call_site_trace ( ) {
3336 if !ENABLED {
3437 return ;
@@ -38,7 +41,7 @@ fn backtrace_new_should_start_with_call_site_trace() {
3841
3942 assert ! ( !b. frames( ) . is_empty( ) ) ;
4043
41- let this_ip = backtrace_new_should_start_with_call_site_trace as usize ;
42- let frame_ip = b. frames ( ) . first ( ) . unwrap ( ) . symbol_address ( ) as usize ;
44+ let this_ip = backtrace_new_should_start_with_call_site_trace as * mut c_void ;
45+ let frame_ip = b. frames ( ) . first ( ) . unwrap ( ) . symbol_address ( ) ;
4346 assert_eq ! ( this_ip, frame_ip) ;
4447}
0 commit comments