]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/generic-associated-types/issue-79422.rs
Auto merge of #90535 - tmiasko:clone-from, r=oli-obk
[rust.git] / src / test / ui / generic-associated-types / issue-79422.rs
index 7f0ac348358840c6bc0975e954cc1238345933e1..47ef38ff45d65beadccc13496883013c7420e21d 100644 (file)
@@ -17,12 +17,12 @@ fn t(&'a self) -> &'a T {
 }
 
 trait MapLike<K, V> {
-    type VRefCont<'a>: RefCont<'a, V>;
+    type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
     fn get<'a>(&'a self, key: &K) -> Option<Self::VRefCont<'a>>;
 }
 
 impl<K: Ord, V: 'static> MapLike<K, V> for std::collections::BTreeMap<K, V> {
-    type VRefCont<'a> = &'a V;
+    type VRefCont<'a> where Self: 'a = &'a V;
     fn get<'a>(&'a self, key: &K) -> Option<&'a V> {
         std::collections::BTreeMap::get(self, key)
     }