File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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`.
You can’t perform that action at this time.
0 commit comments