Skip to content

Commit

Permalink
Make ui test bitwidth independent
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Dec 26, 2019
1 parent 12a4c2c commit f65a91e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/test/ui/consts/transmute-size-mismatch-before-typeck.rs
Original file line number Diff line number Diff line change
@@ -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
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr
Original file line number Diff line number Diff line change
@@ -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) };
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
Expand All @@ -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

Expand Down

0 comments on commit f65a91e

Please sign in to comment.