Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d78e3e3
Add platform support document links to tier table
Michcioperz Mar 4, 2022
c1d5c2b
Add missing platform support docs to sidebar
Michcioperz Mar 4, 2022
9cfdb89
Only add codegen backend to dep info if -Zbinary-dep-depinfo is used
bjorn3 Feb 13, 2022
c681a88
Don't include invalid paths in the depinfo for builtin backends
bjorn3 Feb 13, 2022
147e5da
Add test
bjorn3 Mar 24, 2022
d5f3863
Consider lifetimes when comparing types for equality in MIR validator
JakobDegen Apr 13, 2022
4a0f8d5
improve diagnostics for unterminated nested block comment
yue4u Apr 13, 2022
1b7008d
refactor: change to use peekable
yue4u Apr 14, 2022
48029ab
Remove some now-dead code that was only relevant before deaggregation.
oli-obk Apr 14, 2022
9d319f3
update: actions/checkout@v2 to actions/checkout@v3
Gumichocopengin8 Apr 14, 2022
753d567
clarify doc(cfg) wording
euclio Apr 14, 2022
e30d6d9
make unaligned_references lint deny-by-default
RalfJung Mar 27, 2022
1a6c2ff
make unaligned_reference warning visible in future compat report
RalfJung Apr 15, 2022
4117e8c
test: add pop_first() pop_last() test cases for BTreeSet
Gumichocopengin8 Apr 15, 2022
e162602
test: add get_key_value() test cases for BTreeSet
Gumichocopengin8 Apr 15, 2022
3f2f4a3
test: add try_insert() test cases for BTreeSet
Gumichocopengin8 Apr 15, 2022
3f46ba6
chore: formatting
Gumichocopengin8 Apr 15, 2022
5181422
Update mdbook
ehuss Apr 15, 2022
7b8df43
Rollup merge of #93969 - bjorn3:codegen_backend_dep_info, r=pnkfelix
Dylan-DPC Apr 16, 2022
e292641
Rollup merge of #94605 - Michcioperz:patch-1, r=pnkfelix
Dylan-DPC Apr 16, 2022
a21f392
Rollup merge of #95372 - RalfJung:unaligned_references, r=oli-obk
Dylan-DPC Apr 16, 2022
ac01c91
Rollup merge of #95859 - rainy-me:unterminated-nested-block-comment, …
Dylan-DPC Apr 16, 2022
a30dbc2
Rollup merge of #96004 - JakobDegen:fix-validator-ice, r=petrochenkov
Dylan-DPC Apr 16, 2022
466107e
Rollup merge of #96035 - Gumichocopengin8:feature/update-github-actio…
Dylan-DPC Apr 16, 2022
f72689a
Rollup merge of #96050 - oli-obk:deaggregator_cleanup, r=RalfJung
Dylan-DPC Apr 16, 2022
10e8a2a
Rollup merge of #96059 - euclio:doc-cfg, r=manishearth,guillaumegomez
Dylan-DPC Apr 16, 2022
be42af6
Rollup merge of #96070 - Gumichocopengin8:test/btree-map, r=thomcc
Dylan-DPC Apr 16, 2022
45af788
Rollup merge of #96088 - ehuss:update-mdbook, r=Mark-Simulacrum
Dylan-DPC Apr 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add try_insert() test cases for BTreeSet
  • Loading branch information
Gumichocopengin8 committed Apr 15, 2022
commit 3f2f4a35ed89ed02b7192bf3b35b02a4654bb2f0
15 changes: 15 additions & 0 deletions library/alloc/src/collections/btree/map/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,21 @@ fn test_insert_into_full_height_1() {
}
}

#[test]
fn test_try_insert() {
let mut map = BTreeMap::new();

assert!(map.is_empty());

assert_eq!(map.try_insert(1, 10).unwrap(), &10);
assert_eq!(map.try_insert(2, 20).unwrap(), &20);

let err = map.try_insert(2, 200).unwrap_err();
assert_eq!(err.entry.key(), &2);
assert_eq!(err.entry.get(), &20);
assert_eq!(err.value, 200);
}

macro_rules! create_append_test {
($name:ident, $len:expr) => {
#[test]
Expand Down