File tree Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -23,31 +23,31 @@ fn assert_foo<T: Foo>(f: T) {}
23
23
fn main ( ) {
24
24
// Make sure 'static is erased for coroutine interiors so we can't match it in trait selection
25
25
let x: & ' static _ = & OnlyFooIfStaticRef ( No ) ;
26
- let gen = #[ coroutine] move || {
26
+ let generator = #[ coroutine] move || {
27
27
let x = x;
28
28
yield ;
29
29
assert_foo ( x) ;
30
30
} ;
31
- assert_foo ( gen ) ;
31
+ assert_foo ( generator ) ;
32
32
//~^ ERROR implementation of `Foo` is not general enough
33
33
34
34
// Allow impls which matches any lifetime
35
35
let x = & OnlyFooIfRef ( No ) ;
36
- let gen = #[ coroutine] move || {
36
+ let generator = #[ coroutine] move || {
37
37
let x = x;
38
38
yield ;
39
39
assert_foo ( x) ;
40
40
} ;
41
- assert_foo ( gen ) ; // ok
41
+ assert_foo ( generator ) ; // ok
42
42
43
43
// Disallow impls which relates lifetimes in the coroutine interior
44
- let gen = #[ coroutine] move || {
44
+ let generator = #[ coroutine] move || {
45
45
let a = A ( & mut true , & mut true , No ) ;
46
46
//~^ ERROR borrow may still be in use when coroutine yields
47
47
//~| ERROR borrow may still be in use when coroutine yields
48
48
yield ;
49
49
assert_foo ( a) ;
50
50
} ;
51
- assert_foo ( gen ) ;
51
+ assert_foo ( generator ) ;
52
52
//~^ ERROR not general enough
53
53
}
Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ LL | let gen = #[coroutine] static move || {
33
33
error: implementation of `Foo` is not general enough
34
34
--> $DIR/auto-trait-regions.rs:31:5
35
35
|
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
38
38
|
39
39
= note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
40
40
= note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
41
41
42
42
error: implementation of `Foo` is not general enough
43
43
--> $DIR/auto-trait-regions.rs:51:5
44
44
|
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
47
47
|
48
48
= note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
49
49
= note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
Original file line number Diff line number Diff line change 7
7
#![ feature( coroutines, coroutine_clone, stmt_expr_attributes) ]
8
8
9
9
fn main ( ) {
10
- let gen = #[ coroutine]
10
+ let generator = #[ coroutine]
11
11
static move || {
12
12
yield ;
13
13
} ;
14
- check_copy ( & gen ) ;
14
+ check_copy ( & generator ) ;
15
15
//~^ ERROR Copy` is not satisfied
16
- check_clone ( & gen ) ;
16
+ check_clone ( & generator ) ;
17
17
//~^ ERROR Clone` is not satisfied
18
18
}
19
19
Original file line number Diff line number Diff line change 1
1
error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Copy` is not satisfied
2
2
--> $DIR/clone-impl-static.rs:14:16
3
3
|
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}`
6
6
| |
7
7
| required by a bound introduced by this call
8
8
|
@@ -15,8 +15,8 @@ LL | fn check_copy<T: Copy>(_x: &T) {}
15
15
error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Clone` is not satisfied
16
16
--> $DIR/clone-impl-static.rs:16:17
17
17
|
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}`
20
20
| |
21
21
| required by a bound introduced by this call
22
22
|
You can’t perform that action at this time.
0 commit comments