2015-10-24 00:01:11 +03:00
|
|
|
trait MapLookup<Q> {
|
|
|
|
type MapValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<K> MapLookup<K> for K {
|
|
|
|
type MapValue = K;
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Map: MapLookup<<Self as Map>::Key> {
|
|
|
|
type Key;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<K> Map for K {
|
|
|
|
type Key = K;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = &()
|
2019-05-28 14:46:13 -04:00
|
|
|
as &dyn Map<Key=u32,MapValue=u32>;
|
2016-08-08 18:54:16 -04:00
|
|
|
//~^ ERROR E0038
|
2015-10-24 00:01:11 +03:00
|
|
|
}
|