We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e94cf57 commit 5e983d7Copy full SHA for 5e983d7
src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.rs
@@ -8,22 +8,38 @@
8
//~| NOTE: `#[warn(incomplete_features)]` on by default
9
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
10
11
+#[derive(Clone)]
12
struct S {
13
a: String,
14
b: String,
15
}
16
17
+struct T {
18
+ a: String,
19
+ s: S,
20
+}
21
+
22
fn main() {
23
let a = String::new();
24
let b = String::new();
25
+ let c = String::new();
26
let s = S {a, b};
27
+ let t = T {
28
+ a: c,
29
+ s: s.clone()
30
+ };
31
32
let c = || {
33
let s2 = S {
- a: format!("New a"),
34
+ a: format!("New s2"),
35
..s
36
};
37
+ let s3 = S {
38
+ a: format!("New s3"),
39
+ ..t.s
40
41
println!("{} {}", s2.a, s2.b);
42
+ println!("{} {} {}", s3.a, s3.b, t.a);
43
44
45
c();
0 commit comments