File tree 3 files changed +36
-39
lines changed
3 files changed +36
-39
lines changed Original file line number Diff line number Diff line change 1
1
#![ feature( existential_type) ]
2
2
3
3
trait UnwrapItemsExt {
4
- type II ;
5
- fn unwrap_items ( self ) -> Self :: II ;
4
+ type Iter ;
5
+ fn unwrap_items ( self ) -> Self :: Iter ;
6
6
}
7
7
8
8
impl < I , T , E > UnwrapItemsExt for I
9
9
where
10
10
I : Iterator < Item = Result < T , E > > ,
11
11
E : std:: fmt:: Debug ,
12
12
{
13
- existential type II : Iterator < Item = T > ;
13
+ existential type Iter : Iterator < Item = T > ;
14
14
//~^ ERROR: could not find defining uses
15
15
16
- fn unwrap_items ( self ) -> Self :: II {
16
+ fn unwrap_items ( self ) -> Self :: Iter {
17
17
//~^ ERROR: type parameter `T` is part of concrete type
18
18
//~| ERROR: type parameter `E` is part of concrete type
19
19
self . map ( |x| x. unwrap ( ) )
20
20
}
21
21
}
22
+
23
+ fn main ( ) { }
Original file line number Diff line number Diff line change
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
+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments