File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
#![ feature( const_transmute) ]
2
2
3
+ // normalize-stderr-64bit "64 bits" -> "word size"
4
+ // normalize-stderr-32bit "32 bits" -> "word size"
5
+ // normalize-stderr-64bit "128 bits" -> "2 * word size"
6
+ // normalize-stderr-32bit "64 bits" -> "2 * word size"
7
+
3
8
fn main ( ) {
4
9
match & b"" [ ..] {
5
- ZST => { }
6
- //~^ ERROR could not evaluate constant pattern
10
+ ZST => { } //~ ERROR could not evaluate constant pattern
7
11
}
8
12
}
9
13
Original file line number Diff line number Diff line change 1
1
error: any use of this value will cause an error
2
- --> $DIR/transmute-size-mismatch-before-typeck.rs:10 :29
2
+ --> $DIR/transmute-size-mismatch-before-typeck.rs:14 :29
3
3
|
4
4
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
5
5
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -9,19 +9,19 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
9
9
= note: `#[deny(const_err)]` on by default
10
10
11
11
error: could not evaluate constant pattern
12
- --> $DIR/transmute-size-mismatch-before-typeck.rs:5 :9
12
+ --> $DIR/transmute-size-mismatch-before-typeck.rs:10 :9
13
13
|
14
14
LL | ZST => {}
15
15
| ^^^
16
16
17
17
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
18
- --> $DIR/transmute-size-mismatch-before-typeck.rs:10 :29
18
+ --> $DIR/transmute-size-mismatch-before-typeck.rs:14 :29
19
19
|
20
20
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
21
21
| ^^^^^^^^^^^^^^^^^^^
22
22
|
23
- = note: source type: `usize` (64 bits )
24
- = note: target type: `&'static [u8]` (128 bits )
23
+ = note: source type: `usize` (word size )
24
+ = note: target type: `&'static [u8]` (2 * word size )
25
25
26
26
error: aborting due to 3 previous errors
27
27
You can’t perform that action at this time.
0 commit comments