11error[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
33 |
44LL | iter! { || {
55 | _____________^
@@ -11,7 +11,7 @@ LL | | } }
1111 | |_____^ returns a reference to data owned by the current function
1212
1313error: `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
1515 |
1616LL | iter! { move || {
1717 | _____________-^^^^^^
@@ -20,15 +20,15 @@ LL | | for x in 5..10 {
2020LL | | yield x * 2;
2121LL | | }
2222LL | | } }
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
2424
2525error[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
2727 |
2828LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator<Item = u32> {
2929 | ---- ------------------------------------------ opaque type defined here
3030 | |
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
3232LL | iter! { move || {
3333 | _____________^
3434LL | |
@@ -44,12 +44,12 @@ LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator<Item = u32>
4444 | +++++++++
4545
4646error[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
4848 |
4949LL | fn capture_move_once(a: &u32) -> impl FnOnce() -> impl Iterator<Item = u32> {
5050 | ---- ------------------------- opaque type defined here
5151 | |
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
5353LL | iter! { move || {
5454 | _____________^
5555LL | |
0 commit comments