diff --git a/tests/run-pass/packed_struct.rs b/tests/run-pass/packed_struct.rs index 93aecbb3d77..5b3f09c0dd0 100644 --- a/tests/run-pass/packed_struct.rs +++ b/tests/run-pass/packed_struct.rs @@ -9,6 +9,11 @@ fn main() { a: 42, b: 99, }; - assert_eq!(x.a, 42); - assert_eq!(x.b, 99); + let a = x.a; + let b = x.b; + assert_eq!(a, 42); + assert_eq!(b, 99); + // can't do `assert_eq!(x.a, 42)`, because `assert_eq!` takes a reference + assert_eq!({x.a}, 42); + assert_eq!({x.b}, 99); }