rust/tests/ui/zero-sized/zero-sized-tuple-struct.rs
2023-01-11 09:32:08 +00:00

14 lines
243 B
Rust

// run-pass
#![allow(unused_braces)]
#![allow(unused_assignments)]
// 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);
}