X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fui%2Fpacked%2Fpacked-struct-borrow-element-64bit.rs;h=63315ea66737ae09043851c2669eede600d9dba0;hb=643fc97fd3b3f4f34eb2d66af1deac9218835527;hp=00bddfe40b25b7ae3a4e6a00e473f0608cb308cc;hpb=73476554e9f89245be50195d5ff8e66cc5e64c82;p=rust.git diff --git a/tests/ui/packed/packed-struct-borrow-element-64bit.rs b/tests/ui/packed/packed-struct-borrow-element-64bit.rs index 00bddfe40b2..63315ea6673 100644 --- a/tests/ui/packed/packed-struct-borrow-element-64bit.rs +++ b/tests/ui/packed/packed-struct-borrow-element-64bit.rs @@ -1,4 +1,3 @@ -// run-pass (note: this is spec-UB, but it works for now) // ignore-32bit (needs `usize` to be 8-aligned to reproduce all the errors below) #![allow(dead_code)] // ignore-emscripten weird assertion? @@ -9,10 +8,8 @@ struct Foo4C { baz: usize } -#[warn(unaligned_references)] pub fn main() { let foo = Foo4C { bar: 1, baz: 2 }; - let brw = &foo.baz; //~WARN reference to packed field is unaligned - //~^ previously accepted + let brw = &foo.baz; //~ERROR reference to packed field is unaligned assert_eq!(*brw, 2); }