File tree Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1- 660326e9791d5caf3186b14521498c2584a494ab
1+ 57e1da59cd0761330b4ea8d47b16340a78eeafa9
Original file line number Diff line number Diff line change 11fn main ( ) {
2- fn f ( ) { }
2+ fn f ( ) { } //~ ERROR calling a function with more arguments than it expected
33
44 let g = unsafe {
55 std:: mem:: transmute :: < fn ( ) , fn ( i32 ) > ( f)
66 } ;
77
8- g ( 42 ) //~ ERROR calling a function with more arguments than it expected
8+ g ( 42 )
99}
Original file line number Diff line number Diff line change 11fn main ( ) {
2- fn f ( ) -> u32 { 42 }
2+ fn f ( ) -> u32 { 42 } //~ ERROR calling a function with return type u32 passing return place of type ()
33
44 let g = unsafe {
55 std:: mem:: transmute :: < fn ( ) -> u32 , fn ( ) > ( f)
66 } ;
77
8- g ( ) //~ ERROR calling a function with return type u32 passing return place of type ()
8+ g ( )
99}
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ fn main() {
33 let y = & x;
44 let z = & y as * const & i32 as * const u8 ;
55 // the deref fails, because we are reading only a part of the pointer
6- let _val = unsafe { * z } ; //~ ERROR unable to turn this pointer into raw bytes
6+ let _val = unsafe { * z } ; //~ ERROR unable to turn pointer into raw bytes
77}
Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ fn main() {
2424 // starts 1 byte to the right, so using it would actually be wrong!
2525 let d_alias = & mut w. data as * mut _ as * mut * const u8 ;
2626 unsafe {
27- let _x = * d_alias; //~ ERROR unable to turn this pointer into raw bytes
27+ let _x = * d_alias; //~ ERROR unable to turn pointer into raw bytes
2828 }
2929}
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ fn main() {
1010 let bad = unsafe {
1111 std:: mem:: transmute :: < & [ u8 ] , [ u8 ; 8 ] > ( & [ 1u8 ] )
1212 } ;
13- let _val = bad[ 0 ] + bad[ bad. len ( ) -1 ] ; //~ ERROR unable to turn this pointer into raw bytes
13+ let _val = bad[ 0 ] + bad[ bad. len ( ) -1 ] ; //~ ERROR unable to turn pointer into raw bytes
1414}
You can’t perform that action at this time.
0 commit comments