Skip to content

Commit 2403d91

Browse files
committed
remove let x = baz which was obscuring the real error
1 parent 78ec12d commit 2403d91

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
44
LL | x.push(y); //~ ERROR explicit lifetime required
55
| ^
66

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

1516
error: aborting due to previous error
1617

17-
For more information about this error, try `rustc --explain E0282`.
18+
For more information about this error, try `rustc --explain E0621`.

src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
1717
x.push(y); //~ ERROR explicit lifetime required
1818
}
1919
fn main() {
20-
let x = baz;
2120
}

0 commit comments

Comments
 (0)