1 #![feature(generic_associated_types)]
4 fn t(&'a self) -> &'a T;
7 impl<'a, T> RefCont<'a, T> for &'a T {
8 fn t(&'a self) -> &'a T {
13 impl<'a, T> RefCont<'a, T> for Box<T> {
14 fn t(&'a self) -> &'a T {
20 type VRefCont<'a>: RefCont<'a, V>;
21 fn get<'a>(&'a self, key: &K) -> Option<Self::VRefCont<'a>>;
24 impl<K: Ord, V: 'static> MapLike<K, V> for std::collections::BTreeMap<K, V> {
25 type VRefCont<'a> = &'a V;
26 fn get<'a>(&'a self, key: &K) -> Option<&'a V> {
27 std::collections::BTreeMap::get(self, key)
33 impl<K, V: Default> MapLike<K, V> for Source {
34 type VRefCont<'a> = Box<V>;
35 fn get<'a>(&self, _: &K) -> Option<Box<V>> {
36 Some(Box::new(V::default()))
41 let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
42 as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
43 //~^ ERROR missing generics for associated type
45 //~^^^^ ERROR the trait