| error[E0490]: a value of type `&'b ()` is borrowed for too long |
| --> $DIR/E0490.rs:2:20 |
| | |
| LL | let x: &'a _ = &y; |
| | ^^ |
| | |
| note: the type is valid for the lifetime `'a` as defined on the function body at 1:6 |
| --> $DIR/E0490.rs:1:6 |
| | |
| LL | fn f<'a, 'b>(y: &'b ()) { |
| | ^^ |
| note: but the borrow lasts for the lifetime `'b` as defined on the function body at 1:10 |
| --> $DIR/E0490.rs:1:10 |
| | |
| LL | fn f<'a, 'b>(y: &'b ()) { |
| | ^^ |
| |
| error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements |
| --> $DIR/E0490.rs:2:20 |
| | |
| LL | let x: &'a _ = &y; |
| | ^^ |
| | |
| note: first, the lifetime cannot outlive the lifetime `'b` as defined on the function body at 1:10... |
| --> $DIR/E0490.rs:1:10 |
| | |
| LL | fn f<'a, 'b>(y: &'b ()) { |
| | ^^ |
| note: ...so that the type `&'b ()` is not borrowed for too long |
| --> $DIR/E0490.rs:2:20 |
| | |
| LL | let x: &'a _ = &y; |
| | ^^ |
| note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 1:6... |
| --> $DIR/E0490.rs:1:6 |
| | |
| LL | fn f<'a, 'b>(y: &'b ()) { |
| | ^^ |
| note: ...so that reference does not outlive borrowed content |
| --> $DIR/E0490.rs:2:20 |
| | |
| LL | let x: &'a _ = &y; |
| | ^^ |
| |
| error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements |
| --> $DIR/E0490.rs:2:20 |
| | |
| LL | let x: &'a _ = &y; |
| | ^^ |
| | |
| note: first, the lifetime cannot outlive the lifetime `'b` as defined on the function body at 1:10... |
| --> $DIR/E0490.rs:1:10 |
| | |
| LL | fn f<'a, 'b>(y: &'b ()) { |
| | ^^ |
| note: ...so that the expression is assignable |
| --> $DIR/E0490.rs:2:20 |
| | |
| LL | let x: &'a _ = &y; |
| | ^^ |
| = note: expected `&'a &()` |
| found `&'a &'b ()` |
| note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 1:6... |
| --> $DIR/E0490.rs:1:6 |
| | |
| LL | fn f<'a, 'b>(y: &'b ()) { |
| | ^^ |
| note: ...so that the reference type `&'a &()` does not outlive the data it points at |
| --> $DIR/E0490.rs:2:12 |
| | |
| LL | let x: &'a _ = &y; |
| | ^^^^^ |
| |
| error: aborting due to 3 previous errors |
| |
| For more information about this error, try `rustc --explain E0495`. |