Skip to content

Commit

Permalink
Rollup merge of rust-lang#53129 - nikomatsakis:issue-51172-tweak-test…
Browse files Browse the repository at this point in the history
…, r=pnkfelix

remove `let x = baz` which was obscuring the real error

fixes rust-lang#51172
  • Loading branch information
pietroalbini authored Aug 29, 2018
2 parents cbaf492 + f77ad5c commit 644f8f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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;
}

0 comments on commit 644f8f1

Please sign in to comment.