1
1
error: lifetime may not live long enough
2
- --> $DIR/issue-79187-2.rs:9 :24
2
+ --> $DIR/issue-79187-2.rs:16 :24
3
3
|
4
4
LL | take_foo(|a: &i32| a);
5
5
| - - ^ returning this value requires that `'1` must outlive `'2`
@@ -8,7 +8,7 @@ LL | take_foo(|a: &i32| a);
8
8
| let's call the lifetime of this reference `'1`
9
9
10
10
error: lifetime may not live long enough
11
- --> $DIR/issue-79187-2.rs:10 :34
11
+ --> $DIR/issue-79187-2.rs:20 :34
12
12
|
13
13
LL | take_foo(|a: &i32| -> &i32 { a });
14
14
| - - ^ returning this value requires that `'1` must outlive `'2`
@@ -17,7 +17,7 @@ LL | take_foo(|a: &i32| -> &i32 { a });
17
17
| let's call the lifetime of this reference `'1`
18
18
19
19
error: implementation of `FnOnce` is not general enough
20
- --> $DIR/issue-79187-2.rs:8 :5
20
+ --> $DIR/issue-79187-2.rs:12 :5
21
21
|
22
22
LL | take_foo(|a| a);
23
23
| ^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
@@ -26,48 +26,48 @@ LL | take_foo(|a| a);
26
26
= note: ...but it actually implements `FnOnce<(&'2 i32,)>`, for some specific lifetime `'2`
27
27
28
28
error[E0308]: mismatched types
29
- --> $DIR/issue-79187-2.rs:8 :5
29
+ --> $DIR/issue-79187-2.rs:12 :5
30
30
|
31
31
LL | take_foo(|a| a);
32
32
| ^^^^^^^^^^^^^^^ one type is more general than the other
33
33
|
34
34
= note: expected type `for<'r> Fn<(&'r i32,)>`
35
35
found type `Fn<(&i32,)>`
36
36
note: this closure does not fulfill the lifetime requirements
37
- --> $DIR/issue-79187-2.rs:8 :14
37
+ --> $DIR/issue-79187-2.rs:12 :14
38
38
|
39
39
LL | take_foo(|a| a);
40
40
| ^^^^^
41
41
note: the lifetime requirement is introduced here
42
- --> $DIR/issue-79187-2.rs:5 :21
42
+ --> $DIR/issue-79187-2.rs:9 :21
43
43
|
44
44
LL | fn take_foo(_: impl Foo) {}
45
45
| ^^^
46
46
47
47
error[E0308]: mismatched types
48
- --> $DIR/issue-79187-2.rs:9 :5
48
+ --> $DIR/issue-79187-2.rs:16 :5
49
49
|
50
50
LL | take_foo(|a: &i32| a);
51
51
| ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
52
52
|
53
53
= note: expected reference `&i32`
54
54
found reference `&i32`
55
55
note: the lifetime requirement is introduced here
56
- --> $DIR/issue-79187-2.rs:5 :21
56
+ --> $DIR/issue-79187-2.rs:9 :21
57
57
|
58
58
LL | fn take_foo(_: impl Foo) {}
59
59
| ^^^
60
60
61
61
error[E0308]: mismatched types
62
- --> $DIR/issue-79187-2.rs:10 :5
62
+ --> $DIR/issue-79187-2.rs:20 :5
63
63
|
64
64
LL | take_foo(|a: &i32| -> &i32 { a });
65
65
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
66
66
|
67
67
= note: expected reference `&i32`
68
68
found reference `&i32`
69
69
note: the lifetime requirement is introduced here
70
- --> $DIR/issue-79187-2.rs:5 :21
70
+ --> $DIR/issue-79187-2.rs:9 :21
71
71
|
72
72
LL | fn take_foo(_: impl Foo) {}
73
73
| ^^^
0 commit comments