Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove let x = baz which was obscuring the real error #53129

Merged
merged 1 commit into from
Aug 31, 2018
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;
}