fbfd8552ab
Blocks return in a copy of the result of their ending expression, not the direct result of the ending expression, as that may be a local variable which gets zeroed by drop_slot.
20 lines
200 B
Rust
20 lines
200 B
Rust
// xfail-stage0
|
|
|
|
// Regression test for issue #377
|
|
|
|
fn main() {
|
|
auto a = {
|
|
auto b = tup(3);
|
|
b
|
|
};
|
|
|
|
assert a._0 == 3;
|
|
|
|
auto c = {
|
|
auto d = rec(v=3);
|
|
d
|
|
};
|
|
|
|
assert c.v == 3;
|
|
}
|