Skip to content

Commit d7e675d

Browse files
committed
---
yaml --- r: 273803 b: refs/heads/beta c: 589108b h: refs/heads/master i: 273801: 31ffde4 273799: e30bbce
1 parent 11b4f98 commit d7e675d

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 1639f2d2899310038635be2c307b60adf2bde125
26+
refs/heads/beta: 589108baf644ea44a10a7258d67da254e1e09fae
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libstd/collections/hash/map.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)]
16741688
mod test_map {
16751689
use prelude::v1::*;

branches/beta/src/libstd/collections/hash/set.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,21 @@ impl<'a, T, S> Iterator for Union<'a, T, S>
10241024
fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }
10251025
}
10261026

1027+
#[allow(dead_code)]
1028+
fn assert_covariance() {
1029+
fn set<'new>(v: HashSet<&'static str>) -> HashSet<&'new str> { v }
1030+
fn iter<'a, 'new>(v: Iter<'a, &'static str>) -> Iter<'a, &'new str> { v }
1031+
fn into_iter<'new>(v: IntoIter<&'static str>) -> IntoIter<&'new str> { v }
1032+
fn difference<'a, 'new>(v: Difference<'a, &'static str, RandomState>)
1033+
-> Difference<'a, &'new str, RandomState> { v }
1034+
fn symmetric_difference<'a, 'new>(v: SymmetricDifference<'a, &'static str, RandomState>)
1035+
-> SymmetricDifference<'a, &'new str, RandomState> { v }
1036+
fn intersection<'a, 'new>(v: Intersection<'a, &'static str, RandomState>)
1037+
-> Intersection<'a, &'new str, RandomState> { v }
1038+
fn union<'a, 'new>(v: Union<'a, &'static str, RandomState>)
1039+
-> Union<'a, &'new str, RandomState> { v }
1040+
}
1041+
10271042
#[cfg(test)]
10281043
mod test_set {
10291044
use prelude::v1::*;

0 commit comments

Comments
 (0)