diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2015-07-13 18:59:06 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2015-07-13 23:28:58 +0200 |
| commit | 3226858e500fa70b46c18d1accedc60060f2bbc0 (patch) | |
| tree | 2545a73f71d01de3472348fdec4bd2660b3f0628 | |
| parent | eb99f0e4207915f4cb4246d9d6bc6109fa04400c (diff) | |
| download | rust-3226858e500fa70b46c18d1accedc60060f2bbc0.tar.gz rust-3226858e500fa70b46c18d1accedc60060f2bbc0.zip | |
Fix tests for changes in #26241.
| -rw-r--r-- | src/libcollections/str.rs | 2 | ||||
| -rw-r--r-- | src/libcollectionstest/lib.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/str-mut-idx-2.rs | 16 | ||||
| -rw-r--r-- | src/test/compile-fail/str-mut-idx.rs | 5 |
4 files changed, 5 insertions, 19 deletions
diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 4bd86bb6069..f2d8efdfde5 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 233623b8a5e..d161dc7a287 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 aa05d7d5c54..00000000000 --- 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 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 88e90c8244d..73abe6cb59d 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>() -> 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<usize>` is not implemented for the type `str` - //~^^ ERROR `core::ops::Index<usize>` is not implemented for the type `str` + //~| ERROR `core::ops::IndexMut<usize>` is not implemented for the type `str` + //~| ERROR `core::ops::Index<usize>` is not implemented for the type `str` } pub fn main() {} |
