Skip to content

Commit 571b58b

Browse files
Rollup merge of rust-lang#142255 - estebank:edition-diagnostic-changes, r=fee1-dead,WaffleLapkin
Add edition checks for some tests that had divergent output In order to expose edition dependent divergences in some tests in the test suite, add explicit `edition` annotations. Some of these tests might require additional work to *avoid* the divergences, as they might have been unintentional. These are not exhaustive changes, purely opportunistic while I was looking at something else.
2 parents bb145c2 + ce7480d commit 571b58b

File tree

46 files changed

+1193
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1193
-122
lines changed

tests/ui/coroutine/auto-trait-regions.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,31 @@ fn assert_foo<T: Foo>(f: T) {}
2323
fn main() {
2424
// Make sure 'static is erased for coroutine interiors so we can't match it in trait selection
2525
let x: &'static _ = &OnlyFooIfStaticRef(No);
26-
let gen = #[coroutine] move || {
26+
let generator = #[coroutine] move || {
2727
let x = x;
2828
yield;
2929
assert_foo(x);
3030
};
31-
assert_foo(gen);
31+
assert_foo(generator);
3232
//~^ ERROR implementation of `Foo` is not general enough
3333

3434
// Allow impls which matches any lifetime
3535
let x = &OnlyFooIfRef(No);
36-
let gen = #[coroutine] move || {
36+
let generator = #[coroutine] move || {
3737
let x = x;
3838
yield;
3939
assert_foo(x);
4040
};
41-
assert_foo(gen); // ok
41+
assert_foo(generator); // ok
4242

4343
// Disallow impls which relates lifetimes in the coroutine interior
44-
let gen = #[coroutine] move || {
44+
let generator = #[coroutine] move || {
4545
let a = A(&mut true, &mut true, No);
4646
//~^ ERROR borrow may still be in use when coroutine yields
4747
//~| ERROR borrow may still be in use when coroutine yields
4848
yield;
4949
assert_foo(a);
5050
};
51-
assert_foo(gen);
51+
assert_foo(generator);
5252
//~^ ERROR not general enough
5353
}

tests/ui/coroutine/auto-trait-regions.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ LL | let gen = #[coroutine] static move || {
3333
error: implementation of `Foo` is not general enough
3434
--> $DIR/auto-trait-regions.rs:31:5
3535
|
36-
LL | assert_foo(gen);
37-
| ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
36+
LL | assert_foo(generator);
37+
| ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
3838
|
3939
= note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
4040
= note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
4141

4242
error: implementation of `Foo` is not general enough
4343
--> $DIR/auto-trait-regions.rs:51:5
4444
|
45-
LL | assert_foo(gen);
46-
| ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
45+
LL | assert_foo(generator);
46+
| ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
4747
|
4848
= note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
4949
= note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`

tests/ui/coroutine/clone-impl-static.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#![feature(coroutines, coroutine_clone, stmt_expr_attributes)]
88

99
fn main() {
10-
let gen = #[coroutine]
10+
let generator = #[coroutine]
1111
static move || {
1212
yield;
1313
};
14-
check_copy(&gen);
14+
check_copy(&generator);
1515
//~^ ERROR Copy` is not satisfied
16-
check_clone(&gen);
16+
check_clone(&generator);
1717
//~^ ERROR Clone` is not satisfied
1818
}
1919

tests/ui/coroutine/clone-impl-static.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Copy` is not satisfied
22
--> $DIR/clone-impl-static.rs:14:16
33
|
4-
LL | check_copy(&gen);
5-
| ---------- ^^^^ the trait `Copy` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
4+
LL | check_copy(&generator);
5+
| ---------- ^^^^^^^^^^ the trait `Copy` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
66
| |
77
| required by a bound introduced by this call
88
|
@@ -15,8 +15,8 @@ LL | fn check_copy<T: Copy>(_x: &T) {}
1515
error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Clone` is not satisfied
1616
--> $DIR/clone-impl-static.rs:16:17
1717
|
18-
LL | check_clone(&gen);
19-
| ----------- ^^^^ the trait `Clone` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
18+
LL | check_clone(&generator);
19+
| ----------- ^^^^^^^^^^ the trait `Clone` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
2020
| |
2121
| required by a bound introduced by this call
2222
|

tests/ui/did_you_mean/bad-assoc-ty.stderr renamed to tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: missing angle brackets in associated item path
2-
--> $DIR/bad-assoc-ty.rs:1:10
2+
--> $DIR/bad-assoc-ty.rs:5:10
33
|
44
LL | type A = [u8; 4]::AssocTy;
55
| ^^^^^^^
@@ -10,7 +10,7 @@ LL | type A = <[u8; 4]>::AssocTy;
1010
| + +
1111

1212
error: missing angle brackets in associated item path
13-
--> $DIR/bad-assoc-ty.rs:5:10
13+
--> $DIR/bad-assoc-ty.rs:9:10
1414
|
1515
LL | type B = [u8]::AssocTy;
1616
| ^^^^
@@ -21,7 +21,7 @@ LL | type B = <[u8]>::AssocTy;
2121
| + +
2222

2323
error: missing angle brackets in associated item path
24-
--> $DIR/bad-assoc-ty.rs:9:10
24+
--> $DIR/bad-assoc-ty.rs:13:10
2525
|
2626
LL | type C = (u8)::AssocTy;
2727
| ^^^^
@@ -32,7 +32,7 @@ LL | type C = <(u8)>::AssocTy;
3232
| + +
3333

3434
error: missing angle brackets in associated item path
35-
--> $DIR/bad-assoc-ty.rs:13:10
35+
--> $DIR/bad-assoc-ty.rs:17:10
3636
|
3737
LL | type D = (u8, u8)::AssocTy;
3838
| ^^^^^^^^
@@ -43,7 +43,7 @@ LL | type D = <(u8, u8)>::AssocTy;
4343
| + +
4444

4545
error: missing angle brackets in associated item path
46-
--> $DIR/bad-assoc-ty.rs:17:10
46+
--> $DIR/bad-assoc-ty.rs:21:10
4747
|
4848
LL | type E = _::AssocTy;
4949
| ^
@@ -54,7 +54,7 @@ LL | type E = <_>::AssocTy;
5454
| + +
5555

5656
error: missing angle brackets in associated item path
57-
--> $DIR/bad-assoc-ty.rs:21:19
57+
--> $DIR/bad-assoc-ty.rs:25:19
5858
|
5959
LL | type F = &'static (u8)::AssocTy;
6060
| ^^^^
@@ -65,7 +65,7 @@ LL | type F = &'static <(u8)>::AssocTy;
6565
| + +
6666

6767
error: missing angle brackets in associated item path
68-
--> $DIR/bad-assoc-ty.rs:27:10
68+
--> $DIR/bad-assoc-ty.rs:31:10
6969
|
7070
LL | type G = dyn 'static + (Send)::AssocTy;
7171
| ^^^^^^^^^^^^^^^^^^^^
@@ -76,7 +76,7 @@ LL | type G = <dyn 'static + (Send)>::AssocTy;
7676
| + +
7777

7878
error: missing angle brackets in associated item path
79-
--> $DIR/bad-assoc-ty.rs:46:10
79+
--> $DIR/bad-assoc-ty.rs:51:10
8080
|
8181
LL | type I = ty!()::AssocTy;
8282
| ^^^^^
@@ -87,7 +87,7 @@ LL | type I = <ty!()>::AssocTy;
8787
| + +
8888

8989
error: missing angle brackets in associated item path
90-
--> $DIR/bad-assoc-ty.rs:39:19
90+
--> $DIR/bad-assoc-ty.rs:44:19
9191
|
9292
LL | ($ty: ty) => ($ty::AssocTy);
9393
| ^^^
@@ -102,7 +102,7 @@ LL | ($ty: ty) => (<$ty>::AssocTy);
102102
| + +
103103

104104
error[E0223]: ambiguous associated type
105-
--> $DIR/bad-assoc-ty.rs:1:10
105+
--> $DIR/bad-assoc-ty.rs:5:10
106106
|
107107
LL | type A = [u8; 4]::AssocTy;
108108
| ^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL + type A = <[u8; 4] as Example>::AssocTy;
114114
|
115115

116116
error[E0223]: ambiguous associated type
117-
--> $DIR/bad-assoc-ty.rs:5:10
117+
--> $DIR/bad-assoc-ty.rs:9:10
118118
|
119119
LL | type B = [u8]::AssocTy;
120120
| ^^^^^^^^^^^^^
@@ -126,7 +126,7 @@ LL + type B = <[u8] as Example>::AssocTy;
126126
|
127127

128128
error[E0223]: ambiguous associated type
129-
--> $DIR/bad-assoc-ty.rs:9:10
129+
--> $DIR/bad-assoc-ty.rs:13:10
130130
|
131131
LL | type C = (u8)::AssocTy;
132132
| ^^^^^^^^^^^^^
@@ -138,7 +138,7 @@ LL + type C = <u8 as Example>::AssocTy;
138138
|
139139

140140
error[E0223]: ambiguous associated type
141-
--> $DIR/bad-assoc-ty.rs:13:10
141+
--> $DIR/bad-assoc-ty.rs:17:10
142142
|
143143
LL | type D = (u8, u8)::AssocTy;
144144
| ^^^^^^^^^^^^^^^^^
@@ -150,13 +150,13 @@ LL + type D = <(u8, u8) as Example>::AssocTy;
150150
|
151151

152152
error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
153-
--> $DIR/bad-assoc-ty.rs:17:10
153+
--> $DIR/bad-assoc-ty.rs:21:10
154154
|
155155
LL | type E = _::AssocTy;
156156
| ^ not allowed in type signatures
157157

158158
error[E0223]: ambiguous associated type
159-
--> $DIR/bad-assoc-ty.rs:21:19
159+
--> $DIR/bad-assoc-ty.rs:25:19
160160
|
161161
LL | type F = &'static (u8)::AssocTy;
162162
| ^^^^^^^^^^^^^
@@ -168,7 +168,7 @@ LL + type F = &'static <u8 as Example>::AssocTy;
168168
|
169169

170170
error[E0223]: ambiguous associated type
171-
--> $DIR/bad-assoc-ty.rs:27:10
171+
--> $DIR/bad-assoc-ty.rs:31:10
172172
|
173173
LL | type G = dyn 'static + (Send)::AssocTy;
174174
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -180,7 +180,7 @@ LL + type G = <(dyn Send + 'static) as Example>::AssocTy;
180180
|
181181

182182
warning: trait objects without an explicit `dyn` are deprecated
183-
--> $DIR/bad-assoc-ty.rs:33:10
183+
--> $DIR/bad-assoc-ty.rs:37:10
184184
|
185185
LL | type H = Fn(u8) -> (u8)::Output;
186186
| ^^^^^^^^^^^^^^
@@ -194,7 +194,7 @@ LL | type H = <dyn Fn(u8) -> (u8)>::Output;
194194
| ++++ +
195195

196196
error[E0223]: ambiguous associated type
197-
--> $DIR/bad-assoc-ty.rs:33:10
197+
--> $DIR/bad-assoc-ty.rs:37:10
198198
|
199199
LL | type H = Fn(u8) -> (u8)::Output;
200200
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -209,7 +209,7 @@ LL + type H = <(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output;
209209
|
210210

211211
error[E0223]: ambiguous associated type
212-
--> $DIR/bad-assoc-ty.rs:39:19
212+
--> $DIR/bad-assoc-ty.rs:44:19
213213
|
214214
LL | ($ty: ty) => ($ty::AssocTy);
215215
| ^^^^^^^^^^^^
@@ -225,7 +225,7 @@ LL + ($ty: ty) => (<u8 as Example>::AssocTy);
225225
|
226226

227227
error[E0223]: ambiguous associated type
228-
--> $DIR/bad-assoc-ty.rs:46:10
228+
--> $DIR/bad-assoc-ty.rs:51:10
229229
|
230230
LL | type I = ty!()::AssocTy;
231231
| ^^^^^^^^^^^^^^
@@ -237,15 +237,15 @@ LL + type I = <u8 as Example>::AssocTy;
237237
|
238238

239239
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
240-
--> $DIR/bad-assoc-ty.rs:51:13
240+
--> $DIR/bad-assoc-ty.rs:56:13
241241
|
242242
LL | fn foo<X: K<_, _>>(x: X) {}
243243
| ^ ^ not allowed in type signatures
244244
| |
245245
| not allowed in type signatures
246246

247247
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
248-
--> $DIR/bad-assoc-ty.rs:54:34
248+
--> $DIR/bad-assoc-ty.rs:59:34
249249
|
250250
LL | fn bar<F>(_: F) where F: Fn() -> _ {}
251251
| ^ not allowed in type signatures
@@ -257,7 +257,7 @@ LL + fn bar<F, T>(_: F) where F: Fn() -> T {}
257257
|
258258

259259
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
260-
--> $DIR/bad-assoc-ty.rs:57:19
260+
--> $DIR/bad-assoc-ty.rs:62:19
261261
|
262262
LL | fn baz<F: Fn() -> _>(_: F) {}
263263
| ^ not allowed in type signatures
@@ -269,7 +269,7 @@ LL + fn baz<F: Fn() -> T, T>(_: F) {}
269269
|
270270

271271
error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
272-
--> $DIR/bad-assoc-ty.rs:60:33
272+
--> $DIR/bad-assoc-ty.rs:65:33
273273
|
274274
LL | struct L<F>(F) where F: Fn() -> _;
275275
| ^ not allowed in type signatures
@@ -281,7 +281,7 @@ LL + struct L<F, T>(F) where F: Fn() -> T;
281281
|
282282

283283
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
284-
--> $DIR/bad-assoc-ty.rs:82:38
284+
--> $DIR/bad-assoc-ty.rs:87:38
285285
|
286286
LL | fn foo<F>(_: F) where F: Fn() -> _ {}
287287
| ^ not allowed in type signatures
@@ -293,7 +293,7 @@ LL + fn foo<F, T>(_: F) where F: Fn() -> T {}
293293
|
294294

295295
error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
296-
--> $DIR/bad-assoc-ty.rs:62:30
296+
--> $DIR/bad-assoc-ty.rs:67:30
297297
|
298298
LL | struct M<F> where F: Fn() -> _ {
299299
| ^ not allowed in type signatures
@@ -305,7 +305,7 @@ LL + struct M<F, T> where F: Fn() -> T {
305305
|
306306

307307
error[E0121]: the placeholder `_` is not allowed within types on item signatures for enums
308-
--> $DIR/bad-assoc-ty.rs:66:28
308+
--> $DIR/bad-assoc-ty.rs:71:28
309309
|
310310
LL | enum N<F> where F: Fn() -> _ {
311311
| ^ not allowed in type signatures
@@ -317,7 +317,7 @@ LL + enum N<F, T> where F: Fn() -> T {
317317
|
318318

319319
error[E0121]: the placeholder `_` is not allowed within types on item signatures for unions
320-
--> $DIR/bad-assoc-ty.rs:71:29
320+
--> $DIR/bad-assoc-ty.rs:76:29
321321
|
322322
LL | union O<F> where F: Fn() -> _ {
323323
| ^ not allowed in type signatures
@@ -329,7 +329,7 @@ LL + union O<F, T> where F: Fn() -> T {
329329
|
330330

331331
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
332-
--> $DIR/bad-assoc-ty.rs:73:5
332+
--> $DIR/bad-assoc-ty.rs:78:5
333333
|
334334
LL | foo: F,
335335
| ^^^^^^
@@ -341,7 +341,7 @@ LL | foo: std::mem::ManuallyDrop<F>,
341341
| +++++++++++++++++++++++ +
342342

343343
error[E0121]: the placeholder `_` is not allowed within types on item signatures for traits
344-
--> $DIR/bad-assoc-ty.rs:77:29
344+
--> $DIR/bad-assoc-ty.rs:82:29
345345
|
346346
LL | trait P<F> where F: Fn() -> _ {
347347
| ^ not allowed in type signatures

0 commit comments

Comments
 (0)