Skip to content

Commit

Permalink
Move into existential-type dir
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jul 21, 2019
1 parent 18dceab commit e75ae15
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#![feature(existential_type)]

trait UnwrapItemsExt {
type II;
fn unwrap_items(self) -> Self::II;
type Iter;
fn unwrap_items(self) -> Self::Iter;
}

impl<I, T, E> UnwrapItemsExt for I
where
I: Iterator<Item = Result<T, E>>,
E: std::fmt::Debug,
{
existential type II: Iterator<Item = T>;
existential type Iter: Iterator<Item = T>;
//~^ ERROR: could not find defining uses

fn unwrap_items(self) -> Self::II {
fn unwrap_items(self) -> Self::Iter {
//~^ ERROR: type parameter `T` is part of concrete type
//~| ERROR: type parameter `E` is part of concrete type
self.map(|x| x.unwrap())
}
}

fn main() {}
30 changes: 30 additions & 0 deletions src/test/ui/existential-type/issue-58887.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
error: type parameter `T` is part of concrete type but not used in parameter list for existential type
--> $DIR/issue-58887.rs:16:41
|
LL | fn unwrap_items(self) -> Self::Iter {
| _________________________________________^
LL | |
LL | |
LL | | self.map(|x| x.unwrap())
LL | | }
| |_____^

error: type parameter `E` is part of concrete type but not used in parameter list for existential type
--> $DIR/issue-58887.rs:16:41
|
LL | fn unwrap_items(self) -> Self::Iter {
| _________________________________________^
LL | |
LL | |
LL | | self.map(|x| x.unwrap())
LL | | }
| |_____^

error: could not find defining uses
--> $DIR/issue-58887.rs:13:5
|
LL | existential type Iter: Iterator<Item = T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

35 changes: 0 additions & 35 deletions src/test/ui/issues/issue-58887.stderr

This file was deleted.

0 comments on commit e75ae15

Please sign in to comment.