-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait system
Description
It seems #20890 may not be entirely resolved. Take this example,
pub trait BitIter {
type Iter: Iterator<Item=bool>;
fn bit_iter(self) -> <Self as BitIter>::Iter;
}
fn hi<T>(arg: T) where
T: BitIter,
//<T as BitIter>::Iter: Iterator<Item=bool>
{
for i in arg.bit_iter() {}
}
rustc 1.0.0-dev (2a51ca0a4 2015-01-25 10:42:41 -0500)
fails to compile this with,
hi.rs:9:18: 9:28 error: type mismatch resolving `<<T as BitIter>::Iter as core::iter::Iterator>::Item == bool`:
expected associated type,
found bool [E0271]
hi.rs:9 for i in arg.bit_iter() {}
^~~~~~~~~~
Unless, of course, I add the bound.
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait system