@@ -1670,6 +1670,20 @@ impl<K, S, Q: ?Sized> super::Recover<Q> for HashMap<K, (), S>
1670
1670
}
1671
1671
}
1672
1672
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
+
1673
1687
#[ cfg( test) ]
1674
1688
mod test_map {
1675
1689
use prelude:: v1:: * ;
0 commit comments