Skip to content

Commit 51334c9

Browse files
authored
Rollup merge of #54853 - davidtwco:issue-52663-missing-lifetime-suggestion-test, r=nikomatsakis
Remove unneccessary error from test, revealing NLL error. Part of #52663. Removes unnecessary type mismatch error from test that was hiding borrow check error from NLL stderr. r? @nikomatsakis
2 parents 402c699 + c07b712 commit 51334c9

File tree

3 files changed

+11
-28
lines changed

3 files changed

+11
-28
lines changed
+8-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
error[E0308]: mismatched types
2-
--> $DIR/issue-13058.rs:36:11
1+
error[E0621]: explicit lifetime required in the type of `cont`
2+
--> $DIR/issue-13058.rs:24:21
33
|
4-
LL | check((3, 5));
5-
| ^^^^^^
6-
| |
7-
| expected reference, found tuple
8-
| help: consider borrowing here: `&(3, 5)`
9-
|
10-
= note: expected type `&_`
11-
found type `({integer}, {integer})`
4+
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
5+
| -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`
6+
LL | {
7+
LL | let cont_iter = cont.iter();
8+
| ^^^^^^^^^^^ lifetime `'r` required
129

1310
error: aborting due to previous error
1411

15-
For more information about this error, try `rustc --explain E0308`.
12+
For more information about this error, try `rustc --explain E0621`.

src/test/ui/issues/issue-13058.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,5 @@ fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
3333
}
3434

3535
fn main() {
36-
check((3, 5));
37-
//~^ ERROR mismatched types
36+
check(&(3, 5));
3837
}

src/test/ui/issues/issue-13058.stderr

+2-15
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ LL | {
77
LL | let cont_iter = cont.iter();
88
| ^^^^ lifetime `'r` required
99

10-
error[E0308]: mismatched types
11-
--> $DIR/issue-13058.rs:36:11
12-
|
13-
LL | check((3, 5));
14-
| ^^^^^^
15-
| |
16-
| expected reference, found tuple
17-
| help: consider borrowing here: `&(3, 5)`
18-
|
19-
= note: expected type `&_`
20-
found type `({integer}, {integer})`
21-
22-
error: aborting due to 2 previous errors
10+
error: aborting due to previous error
2311

24-
Some errors occurred: E0308, E0621.
25-
For more information about an error, try `rustc --explain E0308`.
12+
For more information about this error, try `rustc --explain E0621`.

0 commit comments

Comments
 (0)