Skip to content

Commit 18dceab

Browse files
committed
Add tests for issue-58887
1 parent 95b1fe5 commit 18dceab

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#![feature(existential_type)]
2+
3+
trait UnwrapItemsExt {
4+
type II;
5+
fn unwrap_items(self) -> Self::II;
6+
}
7+
8+
impl<I, T, E> UnwrapItemsExt for I
9+
where
10+
I: Iterator<Item = Result<T, E>>,
11+
E: std::fmt::Debug,
12+
{
13+
existential type II: Iterator<Item = T>;
14+
//~^ ERROR: could not find defining uses
15+
16+
fn unwrap_items(self) -> Self::II {
17+
//~^ ERROR: type parameter `T` is part of concrete type
18+
//~| ERROR: type parameter `E` is part of concrete type
19+
self.map(|x| x.unwrap())
20+
}
21+
}

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
error[E0601]: `main` function not found in crate `issue_58887`
2+
|
3+
= note: consider adding a `main` function to `$DIR/issue-58887.rs`
4+
5+
error: type parameter `T` is part of concrete type but not used in parameter list for existential type
6+
--> $DIR/issue-58887.rs:16:39
7+
|
8+
LL | fn unwrap_items(self) -> Self::II {
9+
| _______________________________________^
10+
LL | |
11+
LL | |
12+
LL | | self.map(|x| x.unwrap())
13+
LL | | }
14+
| |_____^
15+
16+
error: type parameter `E` is part of concrete type but not used in parameter list for existential type
17+
--> $DIR/issue-58887.rs:16:39
18+
|
19+
LL | fn unwrap_items(self) -> Self::II {
20+
| _______________________________________^
21+
LL | |
22+
LL | |
23+
LL | | self.map(|x| x.unwrap())
24+
LL | | }
25+
| |_____^
26+
27+
error: could not find defining uses
28+
--> $DIR/issue-58887.rs:13:5
29+
|
30+
LL | existential type II: Iterator<Item = T>;
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
33+
error: aborting due to 4 previous errors
34+
35+
For more information about this error, try `rustc --explain E0601`.

0 commit comments

Comments
 (0)