1
1
error[E0515]: cannot return reference to function parameter `a`
2
- --> $DIR/generator_returned_from_fn.rs:26 :13
2
+ --> $DIR/generator_returned_from_fn.rs:24 :13
3
3
|
4
4
LL | iter! { || {
5
5
| _____________^
@@ -11,7 +11,7 @@ LL | | } }
11
11
| |_____^ returns a reference to data owned by the current function
12
12
13
13
error: `gen` closure does not implement `Fn` because it captures state from its environment
14
- --> $DIR/generator_returned_from_fn.rs:35 :13
14
+ --> $DIR/generator_returned_from_fn.rs:33 :13
15
15
|
16
16
LL | iter! { move || {
17
17
| _____________-^^^^^^
@@ -20,15 +20,15 @@ LL | | for x in 5..10 {
20
20
LL | | yield x * 2;
21
21
LL | | }
22
22
LL | | } }
23
- | |_____- return type was inferred to be `{gen closure@$DIR/generator_returned_from_fn.rs:35 :13: 35 :20}` here
23
+ | |_____- return type was inferred to be `{gen closure@$DIR/generator_returned_from_fn.rs:33 :13: 33 :20}` here
24
24
25
25
error[E0700]: hidden type for `impl FnOnce() -> impl Iterator<Item = u32>` captures lifetime that does not appear in bounds
26
- --> $DIR/generator_returned_from_fn.rs:44 :13
26
+ --> $DIR/generator_returned_from_fn.rs:42 :13
27
27
|
28
28
LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator<Item = u32> {
29
29
| ---- ------------------------------------------ opaque type defined here
30
30
| |
31
- | hidden type `{gen closure@$DIR/generator_returned_from_fn.rs:44 :13: 44 :20}` captures the anonymous lifetime defined here
31
+ | hidden type `{gen closure@$DIR/generator_returned_from_fn.rs:42 :13: 42 :20}` captures the anonymous lifetime defined here
32
32
LL | iter! { move || {
33
33
| _____________^
34
34
LL | |
@@ -44,12 +44,12 @@ LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator<Item = u32>
44
44
| +++++++++
45
45
46
46
error[E0700]: hidden type for `impl Iterator<Item = u32>` captures lifetime that does not appear in bounds
47
- --> $DIR/generator_returned_from_fn.rs:44 :13
47
+ --> $DIR/generator_returned_from_fn.rs:42 :13
48
48
|
49
49
LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator<Item = u32> {
50
50
| ---- ------------------------- opaque type defined here
51
51
| |
52
- | hidden type `{gen closure body@$DIR/generator_returned_from_fn.rs:44 :21: 51 :6}` captures the anonymous lifetime defined here
52
+ | hidden type `{gen closure body@$DIR/generator_returned_from_fn.rs:42 :21: 49 :6}` captures the anonymous lifetime defined here
53
53
LL | iter! { move || {
54
54
| _____________^
55
55
LL | |
0 commit comments