Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ warning: not reporting region error due to nll
LL | x.push(y); //~ ERROR explicit lifetime required
| ^

error[E0282]: type annotations needed
--> $DIR/ex2a-push-one-existing-name-early-bound.rs:20:9
error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:5
|
LL | let x = baz;
| - ^^^ cannot infer type for `T`
| |
| consider giving `x` a type
LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
...
LL | x.push(y); //~ ERROR explicit lifetime required
| ^^^^^^^^^ lifetime `'a` required

error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
For more information about this error, try `rustc --explain E0621`.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
x.push(y); //~ ERROR explicit lifetime required
}
fn main() {
let x = baz;
}