File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
// error-pattern: type validation failed: encountered a pointer
2
+ // normalize-stderr-test: "\[u8; (08|16)\]" -> "$$ARRAY"
2
3
3
4
fn main ( ) {
4
5
#[ cfg( target_pointer_width="64" ) ]
@@ -7,7 +8,7 @@ fn main() {
7
8
} ;
8
9
#[ cfg( target_pointer_width="32" ) ]
9
10
let bad = unsafe {
10
- std:: mem:: transmute :: < & [ u8 ] , [ u8 ; 8 ] > ( & [ 1u8 ] )
11
+ std:: mem:: transmute :: < & [ u8 ] , [ u8 ; 08 ] > ( & [ 1u8 ] )
11
12
} ;
12
13
let _val = bad[ 0 ] + bad[ bad. len ( ) -1 ] ;
13
14
}
Original file line number Diff line number Diff line change 1
1
error: Undefined Behavior: type validation failed: encountered a pointer, but expected plain (non-pointer) bytes
2
2
--> $DIR/transmute_fat1.rs:LL:CC
3
3
|
4
- LL | std::mem::transmute::<&[u8], [u8; 16] >(&[1u8])
4
+ LL | std::mem::transmute::<&[u8], $ARRAY >(&[1u8])
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected plain (non-pointer) bytes
6
6
|
7
7
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
You can’t perform that action at this time.
0 commit comments