11// We test the `align_offset` panic below, make sure we test the interpreter impl and not the "real" one.
2- //@compile-flags: -Zmiri-symbolic-alignment-check -Zmiri-permissive-provenance
2+ //@compile-flags: -Zmiri-symbolic-alignment-check
33#![ feature( never_type) ]
44#![ allow( unconditional_panic, non_fmt_panics) ]
55
@@ -48,14 +48,16 @@ fn main() {
4848 } ) ) ;
4949
5050 // Std panics
51- test ( None , |_old_val| std:: panic!( "Hello from panic: std" ) ) ;
52- test ( None , |old_val| std:: panic:: panic_any ( format ! ( "Hello from panic: {:?}" , old_val) ) ) ;
53- test ( None , |old_val| std:: panic!( "Hello from panic: {:?}" , old_val) ) ;
51+ test ( None , |_old_val| std:: panic!( "Hello from std::panic" ) ) ;
52+ test ( None , |old_val| std:: panic!( "Hello from std::panic: {:?}" , old_val) ) ;
53+ test ( None , |old_val| {
54+ std:: panic:: panic_any ( format ! ( "Hello from std::panic_any: {:?}" , old_val) )
55+ } ) ;
5456 test ( None , |_old_val| std:: panic:: panic_any ( 1337 ) ) ;
5557
5658 // Core panics
57- test ( None , |_old_val| core:: panic!( "Hello from panic: core" ) ) ;
58- test ( None , |old_val| core:: panic!( "Hello from panic: {:?}" , old_val) ) ;
59+ test ( None , |_old_val| core:: panic!( "Hello from core::panic " ) ) ;
60+ test ( None , |old_val| core:: panic!( "Hello from core:: panic: {:?}" , old_val) ) ;
5961
6062 // Built-in panics; also make sure the message is right.
6163 test ( Some ( "index out of bounds: the len is 3 but the index is 4" ) , |_old_val| {
@@ -68,7 +70,7 @@ fn main() {
6870 } ) ;
6971
7072 test ( Some ( "align_offset: align is not a power-of-two" ) , |_old_val| {
71- let _ = ( 0usize as * const u8 ) . align_offset ( 3 ) ;
73+ let _ = std :: ptr :: null :: < u8 > ( ) . align_offset ( 3 ) ;
7274 loop { }
7375 } ) ;
7476
0 commit comments