@@ -12,14 +12,14 @@ fn test1_all_need_migration() {
12
12
let t1 = (String::new(), String::new());
13
13
let t2 = (String::new(), String::new());
14
14
15
- let c = || { let _ = (&t, &t1, &t2); {
15
+ let c = || { let _ = (&t, &t1, &t2);
16
16
//~^ ERROR: drop order affected for closure because of `capture_disjoint_fields`
17
17
//~| HELP:` let _ = (&t, &t1, &t2)` causes `t`, `t1`, `t2` to be fully captured
18
18
19
19
let _t = t.0;
20
20
let _t1 = t1.0;
21
21
let _t2 = t2.0;
22
- } } ;
22
+ };
23
23
24
24
c();
25
25
}
@@ -31,13 +31,13 @@ fn test2_only_precise_paths_need_migration() {
31
31
let t1 = (String::new(), String::new());
32
32
let t2 = (String::new(), String::new());
33
33
34
- let c = || { let _ = (&t, &t1); {
34
+ let c = || { let _ = (&t, &t1);
35
35
//~^ ERROR: drop order affected for closure because of `capture_disjoint_fields`
36
36
//~| HELP:` let _ = (&t, &t1)` causes `t`, `t1` to be fully captured
37
37
let _t = t.0;
38
38
let _t1 = t1.0;
39
39
let _t2 = t2;
40
- } } ;
40
+ };
41
41
42
42
c();
43
43
}
@@ -47,12 +47,12 @@ fn test2_only_precise_paths_need_migration() {
47
47
fn test3_only_by_value_need_migration() {
48
48
let t = (String::new(), String::new());
49
49
let t1 = (String::new(), String::new());
50
- let c = || { let _ = &t; {
50
+ let c = || { let _ = &t;
51
51
//~^ ERROR: drop order affected for closure because of `capture_disjoint_fields`
52
52
//~| HELP: `let _ = &t` causes `t` to be fully captured
53
53
let _t = t.0;
54
54
println!("{}", t1.1);
55
- } } ;
55
+ };
56
56
57
57
c();
58
58
}
@@ -65,12 +65,12 @@ fn test4_only_non_copy_types_need_migration() {
65
65
// `t1` is Copy because all of its elements are Copy
66
66
let t1 = (0i32, 0i32);
67
67
68
- let c = || { let _ = &t; {
68
+ let c = || { let _ = &t;
69
69
//~^ ERROR: drop order affected for closure because of `capture_disjoint_fields`
70
70
//~| HELP: `let _ = &t` causes `t` to be fully captured
71
71
let _t = t.0;
72
72
let _t1 = t1.0;
73
- } } ;
73
+ };
74
74
75
75
c();
76
76
}
@@ -83,12 +83,12 @@ fn test5_only_drop_types_need_migration() {
83
83
// `s` doesn't implement Drop or any elements within it, and doesn't need migration
84
84
let s = S(0i32, 0i32);
85
85
86
- let c = || { let _ = &t; {
86
+ let c = || { let _ = &t;
87
87
//~^ ERROR: drop order affected for closure because of `capture_disjoint_fields`
88
88
//~| HELP: `let _ = &t` causes `t` to be fully captured
89
89
let _t = t.0;
90
90
let _s = s.0;
91
- } } ;
91
+ };
92
92
93
93
c();
94
94
}
@@ -98,11 +98,11 @@ fn test5_only_drop_types_need_migration() {
98
98
fn test6_move_closures_non_copy_types_might_need_migration() {
99
99
let t = (String::new(), String::new());
100
100
let t1 = (String::new(), String::new());
101
- let c = move || { let _ = (&t1, &t); {
101
+ let c = move || { let _ = (&t1, &t);
102
102
//~^ ERROR: drop order affected for closure because of `capture_disjoint_fields`
103
103
//~| HELP: `let _ = (&t1, &t)` causes `t1`, `t` to be fully captured
104
104
println!("{} {}", t1.1, t.1);
105
- } } ;
105
+ };
106
106
107
107
c();
108
108
}
@@ -113,11 +113,11 @@ fn test6_move_closures_non_copy_types_might_need_migration() {
113
113
fn test7_drop_non_drop_aggregate_need_migration() {
114
114
let t = (String::new(), String::new(), 0i32);
115
115
116
- let c = || { let _ = &t; {
116
+ let c = || { let _ = &t;
117
117
//~^ ERROR: drop order affected for closure because of `capture_disjoint_fields`
118
118
//~| HELP: `let _ = &t` causes `t` to be fully captured
119
119
let _t = t.0;
120
- } } ;
120
+ };
121
121
122
122
c();
123
123
}
0 commit comments