Skip to content

Commit f65a91e

Browse files
committed
Make ui test bitwidth independent
1 parent 12a4c2c commit f65a91e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/test/ui/consts/transmute-size-mismatch-before-typeck.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#![feature(const_transmute)]
22

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+
38
fn main() {
49
match &b""[..] {
5-
ZST => {}
6-
//~^ ERROR could not evaluate constant pattern
10+
ZST => {} //~ ERROR could not evaluate constant pattern
711
}
812
}
913

src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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
33
|
44
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
55
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@@ -9,19 +9,19 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
99
= note: `#[deny(const_err)]` on by default
1010

1111
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
1313
|
1414
LL | ZST => {}
1515
| ^^^
1616

1717
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
1919
|
2020
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
2121
| ^^^^^^^^^^^^^^^^^^^
2222
|
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)
2525

2626
error: aborting due to 3 previous errors
2727

0 commit comments

Comments
 (0)