Skip to content

Commit

Permalink
BTree: rename compile-time assertions to match library/alloc/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ssomers committed Dec 10, 2021
1 parent 0b42dea commit c8bc4b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions library/alloc/src/collections/btree/map/tests.rs
Expand Up @@ -1556,7 +1556,7 @@ fn test_clone_from() {
}

#[allow(dead_code)]
fn test_variance() {
fn assert_covariance() {
fn map_key<'new>(v: BTreeMap<&'static str, ()>) -> BTreeMap<&'new str, ()> {
v
}
Expand Down Expand Up @@ -1615,7 +1615,7 @@ fn test_variance() {
}

#[allow(dead_code)]
fn test_sync() {
fn assert_sync() {
fn map<T: Sync>(v: &BTreeMap<T, T>) -> impl Sync + '_ {
v
}
Expand Down Expand Up @@ -1684,7 +1684,7 @@ fn test_sync() {
}

#[allow(dead_code)]
fn test_send() {
fn assert_send() {
fn map<T: Send>(v: BTreeMap<T, T>) -> impl Send {
v
}
Expand Down
6 changes: 3 additions & 3 deletions library/alloc/src/collections/btree/set/tests.rs
Expand Up @@ -513,7 +513,7 @@ fn test_recovery() {
}

#[allow(dead_code)]
fn test_variance() {
fn assert_covariance() {
fn set<'new>(v: BTreeSet<&'static str>) -> BTreeSet<&'new str> {
v
}
Expand All @@ -530,7 +530,7 @@ fn test_variance() {
}

#[allow(dead_code)]
fn test_sync() {
fn assert_sync() {
fn set<T: Sync>(v: &BTreeSet<T>) -> impl Sync + '_ {
v
}
Expand Down Expand Up @@ -569,7 +569,7 @@ fn test_sync() {
}

#[allow(dead_code)]
fn test_send() {
fn assert_send() {
fn set<T: Send>(v: BTreeSet<T>) -> impl Send {
v
}
Expand Down

0 comments on commit c8bc4b7

Please sign in to comment.