diff options
Diffstat (limited to 'src/libcollections')
| -rw-r--r-- | src/libcollections/lib.rs | 3 | ||||
| -rw-r--r-- | src/libcollections/slice.rs | 9 | ||||
| -rw-r--r-- | src/libcollections/string.rs | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 8b9a0ec796e..4d0aaf83907 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -19,8 +19,9 @@ html_root_url = "http://doc.rust-lang.org/master/", html_playground_url = "http://play.rust-lang.org/")] +#![allow(unknown_features)] #![feature(macro_rules, managed_boxes, default_type_params, phase, globs)] -#![feature(unsafe_destructor, import_shadowing)] +#![feature(unsafe_destructor, import_shadowing, slicing_syntax)] #![no_std] #[phase(plugin, link)] extern crate core; diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 9cd01617916..60692ceb401 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -51,9 +51,12 @@ //! interval `[a, b)`: //! //! ```rust -//! let numbers = [0i, 1i, 2i]; -//! let last_numbers = numbers[1..3]; -//! // last_numbers is now &[1i, 2i] +//! #![feature(slicing_syntax)] +//! fn main() { +//! let numbers = [0i, 1i, 2i]; +//! let last_numbers = numbers[1..3]; +//! // last_numbers is now &[1i, 2i] +//! } //! ``` //! //! ## Implementations of other traits diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 31bd377a8de..206e392f664 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -160,7 +160,7 @@ impl String { if i > 0 { unsafe { - res.as_mut_vec().push_all(v.[..i]) + res.as_mut_vec().push_all(v[..i]) }; } @@ -177,7 +177,7 @@ impl String { macro_rules! error(() => ({ unsafe { if subseqidx != i_ { - res.as_mut_vec().push_all(vv[subseqidx..i_]); + res.as_mut_vec().push_all(v[subseqidx..i_]); } subseqidx = i; res.as_mut_vec().push_all(REPLACEMENT); |
