Skip to content

Commit e75ae15

Browse files
committed
Move into existential-type dir
1 parent 18dceab commit e75ae15

File tree

3 files changed

+36
-39
lines changed

3 files changed

+36
-39
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#![feature(existential_type)]
22

33
trait UnwrapItemsExt {
4-
type II;
5-
fn unwrap_items(self) -> Self::II;
4+
type Iter;
5+
fn unwrap_items(self) -> Self::Iter;
66
}
77

88
impl<I, T, E> UnwrapItemsExt for I
99
where
1010
I: Iterator<Item = Result<T, E>>,
1111
E: std::fmt::Debug,
1212
{
13-
existential type II: Iterator<Item = T>;
13+
existential type Iter: Iterator<Item = T>;
1414
//~^ ERROR: could not find defining uses
1515

16-
fn unwrap_items(self) -> Self::II {
16+
fn unwrap_items(self) -> Self::Iter {
1717
//~^ ERROR: type parameter `T` is part of concrete type
1818
//~| ERROR: type parameter `E` is part of concrete type
1919
self.map(|x| x.unwrap())
2020
}
2121
}
22+
23+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error: type parameter `T` is part of concrete type but not used in parameter list for existential type
2+
--> $DIR/issue-58887.rs:16:41
3+
|
4+
LL | fn unwrap_items(self) -> Self::Iter {
5+
| _________________________________________^
6+
LL | |
7+
LL | |
8+
LL | | self.map(|x| x.unwrap())
9+
LL | | }
10+
| |_____^
11+
12+
error: type parameter `E` is part of concrete type but not used in parameter list for existential type
13+
--> $DIR/issue-58887.rs:16:41
14+
|
15+
LL | fn unwrap_items(self) -> Self::Iter {
16+
| _________________________________________^
17+
LL | |
18+
LL | |
19+
LL | | self.map(|x| x.unwrap())
20+
LL | | }
21+
| |_____^
22+
23+
error: could not find defining uses
24+
--> $DIR/issue-58887.rs:13:5
25+
|
26+
LL | existential type Iter: Iterator<Item = T>;
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28+
29+
error: aborting due to 3 previous errors
30+

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

-35
This file was deleted.

0 commit comments

Comments
 (0)