Skip to content

Commit 5e983d7

Browse files
committed
Add a test for syntax like: ..t.s
1 parent e94cf57 commit 5e983d7

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,38 @@
88
//~| NOTE: `#[warn(incomplete_features)]` on by default
99
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
1010

11+
#[derive(Clone)]
1112
struct S {
1213
a: String,
1314
b: String,
1415
}
1516

17+
struct T {
18+
a: String,
19+
s: S,
20+
}
21+
1622
fn main() {
1723
let a = String::new();
1824
let b = String::new();
25+
let c = String::new();
1926
let s = S {a, b};
27+
let t = T {
28+
a: c,
29+
s: s.clone()
30+
};
2031

2132
let c = || {
2233
let s2 = S {
23-
a: format!("New a"),
34+
a: format!("New s2"),
2435
..s
2536
};
37+
let s3 = S {
38+
a: format!("New s3"),
39+
..t.s
40+
};
2641
println!("{} {}", s2.a, s2.b);
42+
println!("{} {} {}", s3.a, s3.b, t.a);
2743
};
2844

2945
c();

0 commit comments

Comments
 (0)