File tree 1 file changed +17
-1
lines changed
src/test/ui/closures/2229_closure_analysis/run_pass
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 8
8
//~| NOTE: `#[warn(incomplete_features)]` on by default
9
9
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
10
10
11
+ #[ derive( Clone ) ]
11
12
struct S {
12
13
a : String ,
13
14
b : String ,
14
15
}
15
16
17
+ struct T {
18
+ a : String ,
19
+ s : S ,
20
+ }
21
+
16
22
fn main ( ) {
17
23
let a = String :: new ( ) ;
18
24
let b = String :: new ( ) ;
25
+ let c = String :: new ( ) ;
19
26
let s = S { a, b} ;
27
+ let t = T {
28
+ a : c,
29
+ s : s. clone ( )
30
+ } ;
20
31
21
32
let c = || {
22
33
let s2 = S {
23
- a : format ! ( "New a " ) ,
34
+ a : format ! ( "New s2 " ) ,
24
35
..s
25
36
} ;
37
+ let s3 = S {
38
+ a : format ! ( "New s3" ) ,
39
+ ..t. s
40
+ } ;
26
41
println ! ( "{} {}" , s2. a, s2. b) ;
42
+ println ! ( "{} {} {}" , s3. a, s3. b, t. a) ;
27
43
} ;
28
44
29
45
c ( ) ;
You can’t perform that action at this time.
0 commit comments