rust/tests/ui/zero-sized/zero-sized-tuple-struct.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
244 B
Rust
Raw Normal View History

//@ run-pass
2020-03-27 20:56:19 +00:00
#![allow(unused_braces)]
#![allow(unused_assignments)]
2018-05-08 13:10:16 +00:00
// Make sure that the constructor args are codegened for zero-sized tuple structs
struct Foo(());
fn main() {
let mut a = 1;
Foo({ a = 2 });
assert_eq!(a, 2);
}