Skip to content

Commit 3b9d04c

Browse files
committed
Auto merge of #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 8f21a5c + 8c3a033 commit 3b9d04c

File tree

46 files changed

+1201
-130
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

+1201
-130
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: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0626]: borrow may still be in use when coroutine yields
22
--> $DIR/auto-trait-regions.rs:45:19
33
|
4-
LL | let gen = #[coroutine] move || {
5-
| ------- within this coroutine
4+
LL | let generator = #[coroutine] move || {
5+
| ------- within this coroutine
66
LL | let a = A(&mut true, &mut true, No);
77
| ^^^^^^^^^
88
...
@@ -11,14 +11,14 @@ LL | yield;
1111
|
1212
help: add `static` to mark this coroutine as unmovable
1313
|
14-
LL | let gen = #[coroutine] static move || {
15-
| ++++++
14+
LL | let generator = #[coroutine] static move || {
15+
| ++++++
1616

1717
error[E0626]: borrow may still be in use when coroutine yields
1818
--> $DIR/auto-trait-regions.rs:45:30
1919
|
20-
LL | let gen = #[coroutine] move || {
21-
| ------- within this coroutine
20+
LL | let generator = #[coroutine] move || {
21+
| ------- within this coroutine
2222
LL | let a = A(&mut true, &mut true, No);
2323
| ^^^^^^^^^
2424
...
@@ -27,23 +27,23 @@ LL | yield;
2727
|
2828
help: add `static` to mark this coroutine as unmovable
2929
|
30-
LL | let gen = #[coroutine] static move || {
31-
| ++++++
30+
LL | let generator = #[coroutine] static move || {
31+
| ++++++
3232

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
|

0 commit comments

Comments
 (0)