Skip to content

Commit f1fb323

Browse files
committed
Do not use gen as binding name
If we ever start testing every edition, using a new keyword unnecessarily will cause divergent output, so pre-emptively change `gen` into `generator`.
1 parent 2801f9a commit f1fb323

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
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
|

0 commit comments

Comments
 (0)