about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorUlrik Sverdrup <root@localhost>2015-05-01 15:34:25 +0200
committerUlrik Sverdrup <root@localhost>2015-05-01 19:51:31 +0200
commitee48e6d192166be08a57dc4f5ba14256c072e9c3 (patch)
treeee1c9e1b9aefe2a1ba00f426061e27ab60cb8cc4 /src/test
parent42bfeec53c266fb0b08ad90d324206bd3d64df16 (diff)
downloadrust-ee48e6d192166be08a57dc4f5ba14256c072e9c3.tar.gz
rust-ee48e6d192166be08a57dc4f5ba14256c072e9c3.zip
collections: Implement String::drain(range) according to RFC 574
`.drain(range)` is unstable and under feature(collections_drain).

This adds a safe way to remove any range of a String as efficiently as
possible.

As noted in the code, this drain iterator has none of the memory safety
issues of the vector version.

RFC tracking issue is #23055
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/sync-send-iterators-in-libcollections.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/run-pass/sync-send-iterators-in-libcollections.rs b/src/test/run-pass/sync-send-iterators-in-libcollections.rs
index d7877bff0cb..7a845788592 100644
--- a/src/test/run-pass/sync-send-iterators-in-libcollections.rs
+++ b/src/test/run-pass/sync-send-iterators-in-libcollections.rs
@@ -21,6 +21,7 @@ use collections::{BitSet, BitVec};
 use collections::{BTreeMap, BTreeSet};
 use collections::EnumSet;
 use collections::LinkedList;
+use collections::String;
 use collections::Vec;
 use collections::VecDeque;
 use collections::VecMap;
@@ -99,4 +100,5 @@ fn main() {
 
     all_sync_send!(Vec::<usize>::new(), into_iter);
     is_sync_send!(Vec::<usize>::new(), drain(..));
+    is_sync_send!(String::new(), drain(..));
 }