11error: lifetime may not live long enough
2- --> $DIR/issue-79187-2.rs:9 :24
2+ --> $DIR/issue-79187-2.rs:16 :24
33 |
44LL | take_foo(|a: &i32| a);
55 | - - ^ returning this value requires that `'1` must outlive `'2`
@@ -8,7 +8,7 @@ LL | take_foo(|a: &i32| a);
88 | let's call the lifetime of this reference `'1`
99
1010error: lifetime may not live long enough
11- --> $DIR/issue-79187-2.rs:10 :34
11+ --> $DIR/issue-79187-2.rs:20 :34
1212 |
1313LL | take_foo(|a: &i32| -> &i32 { a });
1414 | - - ^ returning this value requires that `'1` must outlive `'2`
@@ -17,7 +17,7 @@ LL | take_foo(|a: &i32| -> &i32 { a });
1717 | let's call the lifetime of this reference `'1`
1818
1919error: implementation of `FnOnce` is not general enough
20- --> $DIR/issue-79187-2.rs:8 :5
20+ --> $DIR/issue-79187-2.rs:12 :5
2121 |
2222LL | take_foo(|a| a);
2323 | ^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
@@ -26,48 +26,48 @@ LL | take_foo(|a| a);
2626 = note: ...but it actually implements `FnOnce<(&'2 i32,)>`, for some specific lifetime `'2`
2727
2828error[E0308]: mismatched types
29- --> $DIR/issue-79187-2.rs:8 :5
29+ --> $DIR/issue-79187-2.rs:12 :5
3030 |
3131LL | take_foo(|a| a);
3232 | ^^^^^^^^^^^^^^^ one type is more general than the other
3333 |
3434 = note: expected type `for<'r> Fn<(&'r i32,)>`
3535 found type `Fn<(&i32,)>`
3636note: this closure does not fulfill the lifetime requirements
37- --> $DIR/issue-79187-2.rs:8 :14
37+ --> $DIR/issue-79187-2.rs:12 :14
3838 |
3939LL | take_foo(|a| a);
4040 | ^^^^^
4141note: the lifetime requirement is introduced here
42- --> $DIR/issue-79187-2.rs:5 :21
42+ --> $DIR/issue-79187-2.rs:9 :21
4343 |
4444LL | fn take_foo(_: impl Foo) {}
4545 | ^^^
4646
4747error[E0308]: mismatched types
48- --> $DIR/issue-79187-2.rs:9 :5
48+ --> $DIR/issue-79187-2.rs:16 :5
4949 |
5050LL | take_foo(|a: &i32| a);
5151 | ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
5252 |
5353 = note: expected reference `&i32`
5454 found reference `&i32`
5555note: the lifetime requirement is introduced here
56- --> $DIR/issue-79187-2.rs:5 :21
56+ --> $DIR/issue-79187-2.rs:9 :21
5757 |
5858LL | fn take_foo(_: impl Foo) {}
5959 | ^^^
6060
6161error[E0308]: mismatched types
62- --> $DIR/issue-79187-2.rs:10 :5
62+ --> $DIR/issue-79187-2.rs:20 :5
6363 |
6464LL | take_foo(|a: &i32| -> &i32 { a });
6565 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
6666 |
6767 = note: expected reference `&i32`
6868 found reference `&i32`
6969note: the lifetime requirement is introduced here
70- --> $DIR/issue-79187-2.rs:5 :21
70+ --> $DIR/issue-79187-2.rs:9 :21
7171 |
7272LL | fn take_foo(_: impl Foo) {}
7373 | ^^^
0 commit comments