Skip to content

Commit 7bf56df

Browse files
committed
Revert "Put slicing syntax behind a feature gate."
This reverts commit 95cfc35.
1 parent 2f365ff commit 7bf56df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+43
-105
lines changed

src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#![crate_type = "bin"]
12-
#![feature(phase, slicing_syntax)]
12+
#![feature(phase)]
1313

1414
#![deny(warnings)]
1515

src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3828,7 +3828,7 @@ type signature of `print`, and the cast expression in `main`.
38283828
Within the body of an item that has type parameter declarations, the names of
38293829
its type parameters are types:
38303830

3831-
```ignore
3831+
```
38323832
fn map<A: Clone, B: Clone>(f: |A| -> B, xs: &[A]) -> Vec<B> {
38333833
if xs.len() == 0 {
38343834
return vec![];

src/libcollections/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
html_root_url = "http://doc.rust-lang.org/master/",
2020
html_playground_url = "http://play.rust-lang.org/")]
2121

22-
#![allow(unknown_features)]
2322
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
24-
#![feature(unsafe_destructor, import_shadowing, slicing_syntax)]
23+
#![feature(unsafe_destructor, import_shadowing)]
2524
#![no_std]
2625

2726
#[phase(plugin, link)] extern crate core;

src/libcollections/slice.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,9 @@
5151
//! interval `[a, b)`:
5252
//!
5353
//! ```rust
54-
//! #![feature(slicing_syntax)]
55-
//! fn main() {
56-
//! let numbers = [0i, 1i, 2i];
57-
//! let last_numbers = numbers[1..3];
58-
//! // last_numbers is now &[1i, 2i]
59-
//! }
54+
//! let numbers = [0i, 1i, 2i];
55+
//! let last_numbers = numbers[1..3];
56+
//! // last_numbers is now &[1i, 2i]
6057
//! ```
6158
//!
6259
//! ## Implementations of other traits

src/libcollections/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl String {
160160

161161
if i > 0 {
162162
unsafe {
163-
res.as_mut_vec().push_all(v[..i])
163+
res.as_mut_vec().push_all(v.[..i])
164164
};
165165
}
166166

@@ -177,7 +177,7 @@ impl String {
177177
macro_rules! error(() => ({
178178
unsafe {
179179
if subseqidx != i_ {
180-
res.as_mut_vec().push_all(v[subseqidx..i_]);
180+
res.as_mut_vec().push_all(vv[subseqidx..i_]);
181181
}
182182
subseqidx = i;
183183
res.as_mut_vec().push_all(REPLACEMENT);

src/libcore/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@
5757
html_playground_url = "http://play.rust-lang.org/")]
5858

5959
#![no_std]
60-
#![allow(unknown_features)]
6160
#![feature(globs, intrinsics, lang_items, macro_rules, managed_boxes, phase)]
62-
#![feature(simd, unsafe_destructor, slicing_syntax)]
61+
#![feature(simd, unsafe_destructor)]
6362
#![deny(missing_doc)]
6463

6564
mod macros;

src/libcore/ops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ pub trait IndexMut<Index, Result> {
684684
* A trivial implementation of `Slice`. When `Foo[..Foo]` happens, it ends up
685685
* calling `slice_to`, and therefore, `main` prints `Slicing!`.
686686
*
687-
* ```ignore
687+
* ```
688688
* struct Foo;
689689
*
690690
* impl ::core::ops::Slice<Foo, Foo> for Foo {
@@ -749,7 +749,7 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
749749
* A trivial implementation of `SliceMut`. When `Foo[Foo..]` happens, it ends up
750750
* calling `slice_from_mut`, and therefore, `main` prints `Slicing!`.
751751
*
752-
* ```ignore
752+
* ```
753753
* struct Foo;
754754
*
755755
* impl ::core::ops::SliceMut<Foo, Foo> for Foo {
@@ -771,7 +771,7 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
771771
* }
772772
* }
773773
*
774-
* pub fn main() {
774+
* fn main() {
775775
* Foo[mut Foo..];
776776
* }
777777
* ```

src/libcore/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,13 +814,13 @@ impl<'a,T> MutableSlice<'a, T> for &'a mut [T] {
814814
#[inline]
815815
fn tail_mut(self) -> &'a mut [T] {
816816
let len = self.len();
817-
self[mut 1..len]
817+
self.slice_mut(1, len)
818818
}
819819

820820
#[inline]
821821
fn init_mut(self) -> &'a mut [T] {
822822
let len = self.len();
823-
self[mut 0..len - 1]
823+
self.slice_mut(0, len - 1)
824824
}
825825

826826
#[inline]

src/libcoretest/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
#![feature(globs, unsafe_destructor, macro_rules, slicing_syntax)]
10+
#![feature(globs, unsafe_destructor, macro_rules)]
1111

1212
extern crate core;
1313
extern crate test;

src/libnative/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@
5757

5858
#![deny(unused_result, unused_must_use)]
5959
#![allow(non_camel_case_types, deprecated)]
60-
#![allow(unknown_features)]
61-
#![feature(default_type_params, lang_items, slicing_syntax)]
60+
#![feature(default_type_params, lang_items)]
6261

6362
// NB this crate explicitly does *not* allow glob imports, please seriously
6463
// consider whether they're needed before adding that feature here (the

0 commit comments

Comments
 (0)