From f65a91eb47453448e27a03eccaad581ebc130d1a Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Tue, 24 Dec 2019 14:31:36 +0100 Subject: [PATCH] Make ui test bitwidth independent --- .../ui/consts/transmute-size-mismatch-before-typeck.rs | 8 ++++++-- .../transmute-size-mismatch-before-typeck.stderr | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs b/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs index 1235dd8dcbd9..b5d2b4396f9a 100644 --- a/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs +++ b/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs @@ -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 } } diff --git a/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr b/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr index 74de5dc9aaf8..5f84204f4086 100644 --- a/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr +++ b/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr @@ -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