diff --git a/tests/ui/extern/extern-types-size_of_val.run.stderr b/tests/ui/extern/extern-types-size_of_val.align.run.stderr similarity index 100% rename from tests/ui/extern/extern-types-size_of_val.run.stderr rename to tests/ui/extern/extern-types-size_of_val.align.run.stderr diff --git a/tests/ui/extern/extern-types-size_of_val.rs b/tests/ui/extern/extern-types-size_of_val.rs index c48db60d40adf..c783c79891adb 100644 --- a/tests/ui/extern/extern-types-size_of_val.rs +++ b/tests/ui/extern/extern-types-size_of_val.rs @@ -1,5 +1,6 @@ // run-fail // check-run-results +// revisions: size align // normalize-stderr-test "panicking\.rs:\d+:\d+:" -> "panicking.rs:" #![feature(extern_types)] @@ -13,6 +14,9 @@ fn main() { let x: &A = unsafe { &*(1usize as *const A) }; // These don't have a dynamic size, so this should panic. - assert_eq!(size_of_val(x), 0); - assert_eq!(align_of_val(x), 1); + if cfg!(size) { + assert_eq!(size_of_val(x), 0); + } else { + assert_eq!(align_of_val(x), 1); + } } diff --git a/tests/ui/extern/extern-types-size_of_val.size.run.stderr b/tests/ui/extern/extern-types-size_of_val.size.run.stderr new file mode 100644 index 0000000000000..cf39c71a04b19 --- /dev/null +++ b/tests/ui/extern/extern-types-size_of_val.size.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs: +attempted to compute the size or alignment of extern type `A` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting.