From f77ad5c6e56689bde62f631d75757242a52e5eaf Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 6 Aug 2018 16:41:35 -0400 Subject: [PATCH] remove `let x = baz` which was obscuring the real error --- ...-push-one-existing-name-early-bound.nll.stderr | 15 ++++++++------- .../ex2a-push-one-existing-name-early-bound.rs | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr index c5f3510fa0ed2..b4cbed03153a7 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr @@ -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`. diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs index 18a720f345d7f..cad0a3c6ac13d 100644 --- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs +++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs @@ -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; }