@@ -1670,6 +1670,20 @@ impl<K, S, Q: ?Sized> super::Recover<Q> for HashMap<K, (), S>
16701670 }
16711671}
16721672
1673+ #[ allow( dead_code) ]
1674+ fn assert_covariance ( ) {
1675+ fn map_key < ' new > ( v : HashMap < & ' static str , u8 > ) -> HashMap < & ' new str , u8 > { v }
1676+ fn map_val < ' new > ( v : HashMap < u8 , & ' static str > ) -> HashMap < u8 , & ' new str > { v }
1677+ fn iter_key < ' a , ' new > ( v : Iter < ' a , & ' static str , u8 > ) -> Iter < ' a , & ' new str , u8 > { v }
1678+ fn iter_val < ' a , ' new > ( v : Iter < ' a , u8 , & ' static str > ) -> Iter < ' a , u8 , & ' new str > { v }
1679+ fn into_iter_key < ' new > ( v : IntoIter < & ' static str , u8 > ) -> IntoIter < & ' new str , u8 > { v }
1680+ fn into_iter_val < ' new > ( v : IntoIter < u8 , & ' static str > ) -> IntoIter < u8 , & ' new str > { v }
1681+ fn keys_key < ' a , ' new > ( v : Keys < ' a , & ' static str , u8 > ) -> Keys < ' a , & ' new str , u8 > { v }
1682+ fn keys_val < ' a , ' new > ( v : Keys < ' a , u8 , & ' static str > ) -> Keys < ' a , u8 , & ' new str > { v }
1683+ fn values_key < ' a , ' new > ( v : Values < ' a , & ' static str , u8 > ) -> Values < ' a , & ' new str , u8 > { v }
1684+ fn values_val < ' a , ' new > ( v : Values < ' a , u8 , & ' static str > ) -> Values < ' a , u8 , & ' new str > { v }
1685+ }
1686+
16731687#[ cfg( test) ]
16741688mod test_map {
16751689 use prelude:: v1:: * ;
0 commit comments