Skip to content

Commit 31fcc94

Browse files
committed
Update test output.
1 parent c3b4a1f commit 31fcc94

16 files changed

+108
-81
lines changed

src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ impl Clone for U {
5555

5656
fn test_clone_trait() {
5757
let f = U(S(String::from("Hello World")), T(0));
58-
let c = || { let _ = &f;
58+
let c = || {
59+
let _ = &f;
5960
//~^ ERROR: `Clone` trait implementation for closure and drop order
6061
//~| NOTE: in Rust 2018, this closure would implement `Clone` as `f` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f.1` does not implement `Clone`
6162
//~| NOTE: for more information, see

src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ LL | }
5858
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
5959
help: add a dummy let to cause `f` to be fully captured
6060
|
61-
LL ~ let c = || { let _ = &f;
61+
LL ~ let c = || {
62+
LL + let _ = &f;
6263
LL +
6364
LL +
6465
LL +
6566
LL +
66-
LL + let f_1 = f.1;
6767
...
6868

6969
error: aborting due to 3 previous errors

src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.fixed

+14-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ fn test1_all_need_migration() {
1212
let t1 = (String::new(), String::new());
1313
let t2 = (String::new(), String::new());
1414

15-
let c = || { let _ = (&t, &t1, &t2);
15+
let c = || {
16+
let _ = (&t, &t1, &t2);
1617
//~^ ERROR: drop order
1718
//~| NOTE: for more information, see
1819
//~| HELP: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
@@ -38,7 +39,8 @@ fn test2_only_precise_paths_need_migration() {
3839
let t1 = (String::new(), String::new());
3940
let t2 = (String::new(), String::new());
4041

41-
let c = || { let _ = (&t, &t1);
42+
let c = || {
43+
let _ = (&t, &t1);
4244
//~^ ERROR: drop order
4345
//~| NOTE: for more information, see
4446
//~| HELP: add a dummy let to cause `t`, `t1` to be fully captured
@@ -59,7 +61,8 @@ fn test2_only_precise_paths_need_migration() {
5961
fn test3_only_by_value_need_migration() {
6062
let t = (String::new(), String::new());
6163
let t1 = (String::new(), String::new());
62-
let c = || { let _ = &t;
64+
let c = || {
65+
let _ = &t;
6366
//~^ ERROR: drop order
6467
//~| NOTE: for more information, see
6568
//~| HELP: add a dummy let to cause `t` to be fully captured
@@ -80,7 +83,8 @@ fn test4_only_non_copy_types_need_migration() {
8083
// `t1` is Copy because all of its elements are Copy
8184
let t1 = (0i32, 0i32);
8285

83-
let c = || { let _ = &t;
86+
let c = || {
87+
let _ = &t;
8488
//~^ ERROR: drop order
8589
//~| NOTE: for more information, see
8690
//~| HELP: add a dummy let to cause `t` to be fully captured
@@ -101,7 +105,8 @@ fn test5_only_drop_types_need_migration() {
101105
// `s` doesn't implement Drop or any elements within it, and doesn't need migration
102106
let s = S(0i32, 0i32);
103107

104-
let c = || { let _ = &t;
108+
let c = || {
109+
let _ = &t;
105110
//~^ ERROR: drop order
106111
//~| NOTE: for more information, see
107112
//~| HELP: add a dummy let to cause `t` to be fully captured
@@ -119,7 +124,8 @@ fn test5_only_drop_types_need_migration() {
119124
fn test6_move_closures_non_copy_types_might_need_migration() {
120125
let t = (String::new(), String::new());
121126
let t1 = (String::new(), String::new());
122-
let c = move || { let _ = (&t1, &t);
127+
let c = move || {
128+
let _ = (&t1, &t);
123129
//~^ ERROR: drop order
124130
//~| NOTE: for more information, see
125131
//~| HELP: add a dummy let to cause `t1`, `t` to be fully captured
@@ -139,7 +145,8 @@ fn test6_move_closures_non_copy_types_might_need_migration() {
139145
fn test7_drop_non_drop_aggregate_need_migration() {
140146
let t = (String::new(), String::new(), 0i32);
141147

142-
let c = || { let _ = &t;
148+
let c = || {
149+
let _ = &t;
143150
//~^ ERROR: drop order
144151
//~| NOTE: for more information, see
145152
//~| HELP: add a dummy let to cause `t` to be fully captured

src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr

+14-14
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
2828
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
2929
help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
3030
|
31-
LL ~ let c = || { let _ = (&t, &t1, &t2);
31+
LL ~ let c = || {
32+
LL + let _ = (&t, &t1, &t2);
3233
LL +
3334
LL +
3435
LL +
3536
LL +
36-
LL + let _t = t.0;
3737
...
3838

3939
error: changes to closure capture in Rust 2021 will affect drop order
@@ -57,12 +57,12 @@ LL | }
5757
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
5858
help: add a dummy let to cause `t`, `t1` to be fully captured
5959
|
60-
LL ~ let c = || { let _ = (&t, &t1);
60+
LL ~ let c = || {
61+
LL + let _ = (&t, &t1);
6162
LL +
6263
LL +
6364
LL +
6465
LL + let _t = t.0;
65-
LL +
6666
...
6767

6868
error: changes to closure capture in Rust 2021 will affect drop order
@@ -80,12 +80,12 @@ LL | }
8080
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
8181
help: add a dummy let to cause `t` to be fully captured
8282
|
83-
LL ~ let c = || { let _ = &t;
83+
LL ~ let c = || {
84+
LL + let _ = &t;
8485
LL +
8586
LL +
8687
LL +
8788
LL + let _t = t.0;
88-
LL +
8989
...
9090

9191
error: changes to closure capture in Rust 2021 will affect drop order
@@ -103,12 +103,12 @@ LL | }
103103
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
104104
help: add a dummy let to cause `t` to be fully captured
105105
|
106-
LL ~ let c = || { let _ = &t;
106+
LL ~ let c = || {
107+
LL + let _ = &t;
107108
LL +
108109
LL +
109110
LL +
110111
LL + let _t = t.0;
111-
LL +
112112
...
113113

114114
error: changes to closure capture in Rust 2021 will affect drop order
@@ -126,12 +126,12 @@ LL | }
126126
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
127127
help: add a dummy let to cause `t` to be fully captured
128128
|
129-
LL ~ let c = || { let _ = &t;
129+
LL ~ let c = || {
130+
LL + let _ = &t;
130131
LL +
131132
LL +
132133
LL +
133134
LL + let _t = t.0;
134-
LL +
135135
...
136136

137137
error: changes to closure capture in Rust 2021 will affect drop order
@@ -154,12 +154,12 @@ LL | }
154154
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
155155
help: add a dummy let to cause `t1`, `t` to be fully captured
156156
|
157-
LL ~ let c = move || { let _ = (&t1, &t);
157+
LL ~ let c = move || {
158+
LL + let _ = (&t1, &t);
158159
LL +
159160
LL +
160161
LL +
161162
LL + println!("{} {}", t1.1, t.1);
162-
LL +
163163
...
164164

165165
error: changes to closure capture in Rust 2021 will affect drop order
@@ -177,12 +177,12 @@ LL | }
177177
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
178178
help: add a dummy let to cause `t` to be fully captured
179179
|
180-
LL ~ let c = || { let _ = &t;
180+
LL ~ let c = || {
181+
LL + let _ = &t;
181182
LL +
182183
LL +
183184
LL +
184185
LL + let _t = t.0;
185-
LL +
186186
...
187187

188188
error: aborting due to 7 previous errors

src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ impl<T> Drop for GenericStruct<T> {
3434
fn significant_drop_needs_migration() {
3535
let t = (SigDrop {}, SigDrop {});
3636

37-
let c = || { let _ = &t;
37+
let c = || {
38+
let _ = &t;
3839
//~^ ERROR: drop order
3940
//~| NOTE: for more information, see
4041
//~| HELP: add a dummy let to cause `t` to be fully captured
@@ -54,7 +55,8 @@ fn generic_struct_with_significant_drop_needs_migration() {
5455
let t = Wrapper(GenericStruct(SigDrop {}, SigDrop {}), 5);
5556

5657
// move is used to force i32 to be copied instead of being a ref
57-
let c = move || { let _ = &t;
58+
let c = move || {
59+
let _ = &t;
5860
//~^ ERROR: drop order
5961
//~| NOTE: for more information, see
6062
//~| HELP: add a dummy let to cause `t` to be fully captured

src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
1818
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
1919
help: add a dummy let to cause `t` to be fully captured
2020
|
21-
LL ~ let c = || { let _ = &t;
21+
LL ~ let c = || {
22+
LL + let _ = &t;
2223
LL +
2324
LL +
2425
LL +
2526
LL + let _t = t.0;
26-
LL +
2727
...
2828

2929
error: changes to closure capture in Rust 2021 will affect drop order
@@ -41,12 +41,12 @@ LL | }
4141
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
4242
help: add a dummy let to cause `t` to be fully captured
4343
|
44-
LL ~ let c = move || { let _ = &t;
44+
LL ~ let c = move || {
45+
LL + let _ = &t;
4546
LL +
4647
LL +
4748
LL +
4849
LL + let _t = t.1;
49-
LL +
5050
...
5151

5252
error: aborting due to 2 previous errors

src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ impl Drop for Foo {
1616

1717
fn closure_contains_block() {
1818
let t = (Foo(0), Foo(0));
19-
let c = || { let _ = &t;
19+
let c = || {
20+
let _ = &t;
2021
//~^ ERROR: drop order
2122
//~| NOTE: for more information, see
2223
//~| HELP: add a dummy let to cause `t` to be fully captured

src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
1818
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
1919
help: add a dummy let to cause `t` to be fully captured
2020
|
21-
LL ~ let c = || { let _ = &t;
21+
LL ~ let c = || {
22+
LL + let _ = &t;
2223
LL +
2324
LL +
2425
LL +
2526
LL + let _t = t.0;
26-
LL +
2727
...
2828

2929
error: changes to closure capture in Rust 2021 will affect drop order

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ where
1717
F: FnOnce(),
1818
{
1919
let f = panic::AssertUnwindSafe(f);
20-
let result = panic::catch_unwind(move || { let _ = &f;
20+
let result = panic::catch_unwind(move || {
21+
let _ = &f;
2122
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation for closure
2223
//~| NOTE: in Rust 2018, this closure would implement `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure would no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
2324
//~| NOTE: for more information, see

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
1515
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
1616
help: add a dummy let to cause `f` to be fully captured
1717
|
18-
LL ~ let result = panic::catch_unwind(move || { let _ = &f;
18+
LL ~ let result = panic::catch_unwind(move || {
19+
LL + let _ = &f;
1920
LL +
2021
LL +
2122
LL +
2223
LL +
23-
LL + f.0()
2424
...
2525

2626
error: aborting due to previous error

src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed

+8-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ impl Clone for U {
2020
fn test_multi_issues() {
2121
let f1 = U(S(String::from("foo")), T(0));
2222
let f2 = U(S(String::from("bar")), T(0));
23-
let c = || { let _ = (&f1, &f2);
23+
let c = || {
24+
let _ = (&f1, &f2);
2425
//~^ ERROR: `Clone` trait implementation for closure and drop order
2526
//~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
2627
//~| NOTE: for more information, see
@@ -39,7 +40,8 @@ fn test_multi_issues() {
3940

4041
fn test_capturing_all_disjoint_fields_individually() {
4142
let f1 = U(S(String::from("foo")), T(0));
42-
let c = || { let _ = &f1;
43+
let c = || {
44+
let _ = &f1;
4345
//~^ ERROR: `Clone` trait implementation for closure
4446
//~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
4547
//~| NOTE: for more information, see
@@ -64,7 +66,8 @@ impl Clone for U1 {
6466

6567
fn test_capturing_several_disjoint_fields_individually_1() {
6668
let f1 = U1(S(String::from("foo")), T(0), S(String::from("bar")));
67-
let c = || { let _ = &f1;
69+
let c = || {
70+
let _ = &f1;
6871
//~^ ERROR: `Clone` trait implementation for closure
6972
//~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
7073
//~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.2` does not implement `Clone`
@@ -83,7 +86,8 @@ fn test_capturing_several_disjoint_fields_individually_1() {
8386

8487
fn test_capturing_several_disjoint_fields_individually_2() {
8588
let f1 = U1(S(String::from("foo")), T(0), S(String::from("bar")));
86-
let c = || { let _ = &f1;
89+
let c = || {
90+
let _ = &f1;
8791
//~^ ERROR: `Clone` trait implementation for closure and drop order
8892
//~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
8993
//~| NOTE: for more information, see

src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
2121
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
2222
help: add a dummy let to cause `f1`, `f2` to be fully captured
2323
|
24-
LL ~ let c = || { let _ = (&f1, &f2);
24+
LL ~ let c = || {
25+
LL + let _ = (&f1, &f2);
2526
LL +
2627
LL +
2728
LL +
2829
LL +
29-
LL + let _f_1 = f1.0;
3030
...
3131

3232
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
@@ -41,12 +41,12 @@ LL | let _f_1 = f1.0;
4141
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
4242
help: add a dummy let to cause `f1` to be fully captured
4343
|
44-
LL ~ let c = || { let _ = &f1;
44+
LL ~ let c = || {
45+
LL + let _ = &f1;
4546
LL +
4647
LL +
4748
LL +
4849
LL +
49-
LL + let _f_1 = f1.0;
5050
...
5151

5252
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
@@ -67,8 +67,8 @@ LL | let _f_2 = f1.2;
6767
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
6868
help: add a dummy let to cause `f1` to be fully captured
6969
|
70-
LL ~ let c = || { let _ = &f1;
71-
LL +
70+
LL ~ let c = || {
71+
LL + let _ = &f1;
7272
LL +
7373
LL +
7474
LL +
@@ -96,12 +96,12 @@ LL | }
9696
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
9797
help: add a dummy let to cause `f1` to be fully captured
9898
|
99-
LL ~ let c = || { let _ = &f1;
99+
LL ~ let c = || {
100+
LL + let _ = &f1;
100101
LL +
101102
LL +
102103
LL +
103104
LL +
104-
LL + let _f_0 = f1.0;
105105
...
106106

107107
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure

0 commit comments

Comments
 (0)