rust/src/test/ui/expr-block-slot.rs
2019-07-27 18:56:16 +03:00

14 lines
233 B
Rust

// run-pass
// Regression test for issue #377
struct A { a: isize }
struct V { v: isize }
pub fn main() {
let a = { let b = A {a: 3}; b };
assert_eq!(a.a, 3);
let c = { let d = V {v: 3}; d };
assert_eq!(c.v, 3);
}