diff options
| author | bors <bors@rust-lang.org> | 2020-01-06 09:31:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-01-06 09:31:27 +0000 |
| commit | a80e63f3fa77792e848e3b248acf4c0acda2e310 (patch) | |
| tree | 6e9574bac0128d5184af68d208b2ee8d9e98e416 /src/liballoc/tests | |
| parent | 33640f0e03af2fb31ce380d5389d5545f24ce29a (diff) | |
| parent | 34716a31db9371501fe98100a7aa1566f37c1d23 (diff) | |
| download | rust-a80e63f3fa77792e848e3b248acf4c0acda2e310.tar.gz rust-a80e63f3fa77792e848e3b248acf4c0acda2e310.zip | |
Auto merge of #67917 - Dylan-DPC:rollup-id05y91, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #67800 (Fix ICE involving calling `Instance.ty` during const evaluation) - #67873 (change remove to have a PartialEq bound) - #67897 (Use `as_deref()` to replace `as_ref().map(...)`) - #67906 (Silence `TooGeneric` error) - #67912 (macros: typo fix) - #67915 (Use Self instead of $type) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc/tests')
| -rw-r--r-- | src/liballoc/tests/lib.rs | 1 | ||||
| -rw-r--r-- | src/liballoc/tests/vec.rs | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index 3fdee8bbfdf..c1ae67a1a33 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -11,6 +11,7 @@ #![feature(associated_type_bounds)] #![feature(binary_heap_into_iter_sorted)] #![feature(binary_heap_drain_sorted)] +#![feature(vec_remove_item)] use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; diff --git a/src/liballoc/tests/vec.rs b/src/liballoc/tests/vec.rs index 19acc70c73c..2a9bfefc713 100644 --- a/src/liballoc/tests/vec.rs +++ b/src/liballoc/tests/vec.rs @@ -132,6 +132,21 @@ fn test_extend_ref() { } #[test] +fn test_remove_item() { + let mut v = vec![1, 2, 3]; + v.remove_item(&1); + + assert_eq!(v.len(), 2); + assert_eq!(v, [2, 3]); + + let mut w = vec![1, 2, 3]; + w.remove_item(&4); + + assert_eq!(w.len(), 3); + w.remove_item(&4); +} + +#[test] fn test_slice_from_mut() { let mut values = vec![1, 2, 3, 4, 5]; { |
