File tree Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ allow( integer_to_ptr_transmutes) ]
2+
13fn main ( ) {
24 #[ cfg( all( target_endian = "little" , target_pointer_width = "64" ) ) ]
35 let bad = unsafe { std:: mem:: transmute :: < u128 , & [ u8 ] > ( 42 ) } ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ fn test_bool() {
3232 assert_eq ! ( true ^ true , false ) ;
3333}
3434
35+ #[ allow( integer_to_ptr_transmutes) ]
3536fn test_ptr ( ) {
3637 unsafe {
3738 let p1: * const u8 = :: std:: mem:: transmute ( 0_usize ) ;
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ fn test_bool() {
3535 assert_eq ! ( true ^ true , false ) ;
3636}
3737
38+ #[ allow( integer_to_ptr_transmutes) ]
3839fn test_ptr ( ) {
3940 unsafe {
4041 let p1: * const u8 = :: std:: mem:: transmute ( 0_usize ) ;
You can’t perform that action at this time.
0 commit comments