1 error[E0490]: a value of type `&'b ()` is borrowed for too long
4 LL | let x: &'a _ = &y;
7 note: the type is valid for the lifetime `'a` as defined here
10 LL | fn f<'a, 'b>(y: &'b ()) {
12 note: but the borrow lasts for the lifetime `'b` as defined here
13 --> $DIR/E0490.rs:1:10
15 LL | fn f<'a, 'b>(y: &'b ()) {
18 error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
19 --> $DIR/E0490.rs:2:20
21 LL | let x: &'a _ = &y;
24 note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
25 --> $DIR/E0490.rs:1:10
27 LL | fn f<'a, 'b>(y: &'b ()) {
29 note: ...so that the type `&'b ()` is not borrowed for too long
30 --> $DIR/E0490.rs:2:20
32 LL | let x: &'a _ = &y;
34 note: but, the lifetime must be valid for the lifetime `'a` as defined here...
37 LL | fn f<'a, 'b>(y: &'b ()) {
39 note: ...so that reference does not outlive borrowed content
40 --> $DIR/E0490.rs:2:20
42 LL | let x: &'a _ = &y;
45 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
46 --> $DIR/E0490.rs:2:20
48 LL | let x: &'a _ = &y;
51 note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
52 --> $DIR/E0490.rs:1:10
54 LL | fn f<'a, 'b>(y: &'b ()) {
56 note: ...so that the expression is assignable
57 --> $DIR/E0490.rs:2:20
59 LL | let x: &'a _ = &y;
61 = note: expected `&'a &()`
63 note: but, the lifetime must be valid for the lifetime `'a` as defined here...
66 LL | fn f<'a, 'b>(y: &'b ()) {
68 note: ...so that the reference type `&'a &()` does not outlive the data it points at
69 --> $DIR/E0490.rs:2:12
71 LL | let x: &'a _ = &y;
74 error: aborting due to 3 previous errors
76 For more information about this error, try `rustc --explain E0495`.