Skip to content

Commit 40141cc

Browse files
Rollup merge of rust-lang#53129 - nikomatsakis:issue-51172-tweak-test, r=pnkfelix
remove `let x = baz` which was obscuring the real error fixes rust-lang#51172
2 parents 3fa6f01 + f77ad5c commit 40141cc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: src/test/ui/lifetimes/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+
| -- help: add explicit lifetime `'a` to the type of `y`: `&'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`.

Diff for: src/test/ui/lifetimes/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)