forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#75538 - tmandry:rollup-i8miv8q, r=tmandry
Rollup of 17 pull requests Successful merges: - rust-lang#73943 (Document the unsafe keyword) - rust-lang#74062 (deny(unsafe_op_in_unsafe_fn) in libstd/ffi/c_str.rs) - rust-lang#74185 (Remove liballoc unneeded explicit link) - rust-lang#74192 (Improve documentation on process::Child.std* fields) - rust-lang#74409 (Change Debug impl of SocketAddr and IpAddr to match their Display output) - rust-lang#75195 (BTreeMap: purge innocent use of into_kv_mut) - rust-lang#75214 (Use intra-doc links in `mem::manually_drop` & `mem::maybe_uninit`) - rust-lang#75432 (Switch to intra-doc links in `std::process`) - rust-lang#75482 (Clean up E0752 explanation) - rust-lang#75501 (Move to intra doc links in std::ffi) - rust-lang#75509 (Tweak suggestion for `this` -> `self`) - rust-lang#75511 (Do not emit E0228 when it is implied by E0106) - rust-lang#75515 (Bump std's libc version to 0.2.74) - rust-lang#75517 (Promotion and const interning comments) - rust-lang#75519 (BTreeMap: refactor splitpoint and move testing over to unit test) - rust-lang#75530 (Switch to intra-doc links in os/raw/*.md) - rust-lang#75531 (Migrate unit tests of btree collections to their native breeding ground) Failed merges: r? @ghost
- Loading branch information
Showing
49 changed files
with
725 additions
and
567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 9 additions & 5 deletions
14
library/alloc/tests/btree/map.rs → .../alloc/src/collections/btree/map/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use super::*; | ||
|
||
#[test] | ||
fn test_splitpoint() { | ||
for idx in 0..=CAPACITY { | ||
let (middle_kv_idx, insertion) = splitpoint(idx); | ||
|
||
// Simulate performing the split: | ||
let mut left_len = middle_kv_idx; | ||
let mut right_len = CAPACITY - middle_kv_idx - 1; | ||
match insertion { | ||
InsertionPlace::Left(edge_idx) => { | ||
assert!(edge_idx <= left_len); | ||
left_len += 1; | ||
} | ||
InsertionPlace::Right(edge_idx) => { | ||
assert!(edge_idx <= right_len); | ||
right_len += 1; | ||
} | ||
} | ||
assert!(left_len >= MIN_LEN); | ||
assert!(right_len >= MIN_LEN); | ||
assert!(left_len + right_len == CAPACITY); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::collections::BTreeSet; | ||
|
||
#[test] | ||
fn test_hash() { | ||
use crate::hash; | ||
|
||
let mut x = BTreeSet::new(); | ||
let mut y = BTreeSet::new(); | ||
|
||
x.insert(1); | ||
x.insert(2); | ||
x.insert(3); | ||
|
||
y.insert(3); | ||
y.insert(2); | ||
y.insert(1); | ||
|
||
assert_eq!(hash(&x), hash(&y)); | ||
} |
Oops, something went wrong.