Make ui test bitwidth independent
This commit is contained in:
parent
12a4c2ca18
commit
f65a91eb47
2 changed files with 11 additions and 7 deletions
|
|
@ -1,9 +1,13 @@
|
|||
#![feature(const_transmute)]
|
||||
|
||||
// normalize-stderr-64bit "64 bits" -> "word size"
|
||||
// normalize-stderr-32bit "32 bits" -> "word size"
|
||||
// normalize-stderr-64bit "128 bits" -> "2 * word size"
|
||||
// normalize-stderr-32bit "64 bits" -> "2 * word size"
|
||||
|
||||
fn main() {
|
||||
match &b""[..] {
|
||||
ZST => {}
|
||||
//~^ ERROR could not evaluate constant pattern
|
||||
ZST => {} //~ ERROR could not evaluate constant pattern
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: any use of this value will cause an error
|
||||
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:29
|
||||
--> $DIR/transmute-size-mismatch-before-typeck.rs:14:29
|
||||
|
|
||||
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
|
||||
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
|
||||
|
|
@ -9,19 +9,19 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
|
|||
= note: `#[deny(const_err)]` on by default
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
--> $DIR/transmute-size-mismatch-before-typeck.rs:5:9
|
||||
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:9
|
||||
|
|
||||
LL | ZST => {}
|
||||
| ^^^
|
||||
|
||||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
|
||||
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:29
|
||||
--> $DIR/transmute-size-mismatch-before-typeck.rs:14:29
|
||||
|
|
||||
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: source type: `usize` (64 bits)
|
||||
= note: target type: `&'static [u8]` (128 bits)
|
||||
= note: source type: `usize` (word size)
|
||||
= note: target type: `&'static [u8]` (2 * word size)
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue