]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/issue-79187-2.base.stderr
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / lifetimes / issue-79187-2.base.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-79187-2.rs:12:5
3    |
4 LL |     take_foo(|a| a);
5    |     ^^^^^^^^ lifetime mismatch
6    |
7    = note: expected type `for<'r> Fn<(&'r i32,)>`
8               found type `Fn<(&i32,)>`
9 note: this closure does not fulfill the lifetime requirements
10   --> $DIR/issue-79187-2.rs:12:14
11    |
12 LL |     take_foo(|a| a);
13    |              ^^^^^
14 note: the lifetime requirement is introduced here
15   --> $DIR/issue-79187-2.rs:9:21
16    |
17 LL | fn take_foo(_: impl Foo) {}
18    |                     ^^^
19
20 error[E0308]: mismatched types
21   --> $DIR/issue-79187-2.rs:16:5
22    |
23 LL |     take_foo(|a: &i32| a);
24    |     ^^^^^^^^ lifetime mismatch
25    |
26    = note: expected reference `&i32`
27               found reference `&i32`
28 note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements
29   --> $DIR/issue-79187-2.rs:16:14
30    |
31 LL |     take_foo(|a: &i32| a);
32    |              ^^^^^^^^^^^
33 note: the lifetime requirement is introduced here
34   --> $DIR/issue-79187-2.rs:9:21
35    |
36 LL | fn take_foo(_: impl Foo) {}
37    |                     ^^^
38
39 error[E0308]: mismatched types
40   --> $DIR/issue-79187-2.rs:20:5
41    |
42 LL |     take_foo(|a: &i32| -> &i32 { a });
43    |     ^^^^^^^^ lifetime mismatch
44    |
45    = note: expected reference `&i32`
46               found reference `&i32`
47 note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements
48   --> $DIR/issue-79187-2.rs:20:14
49    |
50 LL |     take_foo(|a: &i32| -> &i32 { a });
51    |              ^^^^^^^^^^^^^^^^^^^^^^^
52 note: the lifetime requirement is introduced here
53   --> $DIR/issue-79187-2.rs:9:21
54    |
55 LL | fn take_foo(_: impl Foo) {}
56    |                     ^^^
57
58 error: aborting due to 3 previous errors
59
60 For more information about this error, try `rustc --explain E0308`.