diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 4bd86bb60695..f2d8efdfde5a 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -780,7 +780,7 @@ impl str { /// /// # Examples /// ``` - /// # #![feature(collections)] + /// # #![feature(str_split_at)] /// let s = "Löwe 老虎 Léopard"; /// let first_space = s.find(' ').unwrap_or(s.len()); /// let (a, b) = s.split_at(first_space); diff --git a/src/libcollectionstest/lib.rs b/src/libcollectionstest/lib.rs index 233623b8a5e4..d161dc7a287f 100644 --- a/src/libcollectionstest/lib.rs +++ b/src/libcollectionstest/lib.rs @@ -44,6 +44,7 @@ #![feature(str_char)] #![feature(str_escape)] #![feature(str_match_indices)] +#![feature(str_split_at)] #![feature(str_utf16)] #![feature(box_str)] #![feature(subslice_offset)] diff --git a/src/test/compile-fail/str-mut-idx-2.rs b/src/test/compile-fail/str-mut-idx-2.rs deleted file mode 100644 index aa05d7d5c54d..000000000000 --- a/src/test/compile-fail/str-mut-idx-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn mutate(mut s: &mut str) { - let _s: &mut str = &mut s[1..2]; - //~^ ERROR cannot borrow immutable indexed content as mutable -} - -pub fn main() {} diff --git a/src/test/compile-fail/str-mut-idx.rs b/src/test/compile-fail/str-mut-idx.rs index 88e90c8244d8..73abe6cb59db 100644 --- a/src/test/compile-fail/str-mut-idx.rs +++ b/src/test/compile-fail/str-mut-idx.rs @@ -13,10 +13,11 @@ fn bot() -> T { loop {} } fn mutate(s: &mut str) { s[1..2] = bot(); //~^ ERROR `core::marker::Sized` is not implemented for the type `str` - //~^^ ERROR `core::marker::Sized` is not implemented for the type `str` + //~| ERROR `core::marker::Sized` is not implemented for the type `str` s[1usize] = bot(); //~^ ERROR `core::ops::Index` is not implemented for the type `str` - //~^^ ERROR `core::ops::Index` is not implemented for the type `str` + //~| ERROR `core::ops::IndexMut` is not implemented for the type `str` + //~| ERROR `core::ops::Index` is not implemented for the type `str` } pub fn main() {}