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

+1-1
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

+1-1
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

+1-2
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

+3-6
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

+2-2
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

+1-2
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

+3-3
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

+2-2
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

+1-1
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

+1-2
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

src/libnum/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
//!
4444
//! [newt]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
4545
46-
#![allow(unknown_features)]
47-
#![feature(macro_rules, slicing_syntax)]
46+
#![feature(macro_rules)]
4847
#![feature(default_type_params)]
4948

5049
#![crate_name = "num"]

src/librbml/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2525
html_root_url = "http://doc.rust-lang.org/master/",
2626
html_playground_url = "http://play.rust-lang.org/")]
27-
#![allow(unknown_features)]
28-
#![feature(macro_rules, phase, slicing_syntax)]
27+
#![feature(macro_rules, phase)]
2928
#![allow(missing_doc)]
3029

3130
extern crate serialize;

src/libregex/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,7 @@
368368
html_root_url = "http://doc.rust-lang.org/master/",
369369
html_playground_url = "http://play.rust-lang.org/")]
370370

371-
#![allow(unknown_features)]
372-
#![feature(macro_rules, phase, slicing_syntax)]
371+
#![feature(macro_rules, phase)]
373372
#![deny(missing_doc)]
374373

375374
#[cfg(test)]

src/librustc/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ This API is completely unstable and subject to change.
2929
html_root_url = "http://doc.rust-lang.org/master/")]
3030

3131
#![allow(deprecated)]
32-
#![allow(unknown_features)]
3332
#![feature(macro_rules, globs, struct_variant, quote)]
34-
#![feature(default_type_params, phase, unsafe_destructor, slicing_syntax)]
33+
#![feature(default_type_params, phase, unsafe_destructor)]
3534

3635
#![feature(rustc_diagnostic_macros)]
3736
#![feature(import_shadowing)]

src/librustc_back/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3232
html_root_url = "http://doc.rust-lang.org/")]
3333

34-
#![allow(unknown_features)]
35-
#![feature(globs, phase, macro_rules, slicing_syntax)]
34+
#![feature(globs, phase, macro_rules)]
3635

3736
#[phase(plugin, link)]
3837
extern crate log;

src/librustdoc/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
#![crate_type = "dylib"]
1616
#![crate_type = "rlib"]
1717

18-
#![allow(unknown_features)]
19-
#![feature(globs, struct_variant, managed_boxes, macro_rules, phase, slicing_syntax)]
18+
#![feature(globs, struct_variant, managed_boxes, macro_rules, phase)]
2019

2120
extern crate arena;
2221
extern crate debug;

src/librustrt/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
1717
html_root_url = "http://doc.rust-lang.org/master/")]
1818

19-
#![allow(unknown_features)]
2019
#![feature(macro_rules, phase, globs, thread_local, managed_boxes, asm)]
2120
#![feature(linkage, lang_items, unsafe_destructor, default_type_params)]
22-
#![feature(import_shadowing, slicing_syntax)]
21+
#![feature(import_shadowing)]
2322
#![no_std]
2423
#![experimental]
2524

src/libserialize/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ Core encoding and decoding interfaces.
2323
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2424
html_root_url = "http://doc.rust-lang.org/master/",
2525
html_playground_url = "http://play.rust-lang.org/")]
26-
#![allow(unknown_features)]
27-
#![feature(macro_rules, managed_boxes, default_type_params, phase, slicing_syntax)]
26+
#![feature(macro_rules, managed_boxes, default_type_params, phase)]
2827

2928
// test harness access
3029
#[cfg(test)]

src/libstd/io/net/udp.rs

+15-18
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,26 @@ use rt::rtio;
3535
///
3636
/// ```rust,no_run
3737
/// # #![allow(unused_must_use)]
38-
/// #![feature(slicing_syntax)]
39-
///
4038
/// use std::io::net::udp::UdpSocket;
4139
/// use std::io::net::ip::{Ipv4Addr, SocketAddr};
42-
/// fn main() {
43-
/// let addr = SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 34254 };
44-
/// let mut socket = match UdpSocket::bind(addr) {
45-
/// Ok(s) => s,
46-
/// Err(e) => fail!("couldn't bind socket: {}", e),
47-
/// };
4840
///
49-
/// let mut buf = [0, ..10];
50-
/// match socket.recv_from(buf) {
51-
/// Ok((amt, src)) => {
52-
/// // Send a reply to the socket we received data from
53-
/// let buf = buf[mut ..amt];
54-
/// buf.reverse();
55-
/// socket.send_to(buf, src);
56-
/// }
57-
/// Err(e) => println!("couldn't receive a datagram: {}", e)
41+
/// let addr = SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 34254 };
42+
/// let mut socket = match UdpSocket::bind(addr) {
43+
/// Ok(s) => s,
44+
/// Err(e) => fail!("couldn't bind socket: {}", e),
45+
/// };
46+
///
47+
/// let mut buf = [0, ..10];
48+
/// match socket.recv_from(buf) {
49+
/// Ok((amt, src)) => {
50+
/// // Send a reply to the socket we received data from
51+
/// let buf = buf[mut ..amt];
52+
/// buf.reverse();
53+
/// socket.send_to(buf, src);
5854
/// }
59-
/// drop(socket); // close the socket
55+
/// Err(e) => println!("couldn't receive a datagram: {}", e)
6056
/// }
57+
/// drop(socket); // close the socket
6158
/// ```
6259
pub struct UdpSocket {
6360
obj: Box<RtioUdpSocket + Send>,

src/libstd/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@
105105
html_root_url = "http://doc.rust-lang.org/master/",
106106
html_playground_url = "http://play.rust-lang.org/")]
107107

108-
#![allow(unknown_features)]
109108
#![feature(macro_rules, globs, managed_boxes, linkage)]
110109
#![feature(default_type_params, phase, lang_items, unsafe_destructor)]
111-
#![feature(import_shadowing, slicing_syntax)]
110+
#![feature(import_shadowing)]
112111

113112
// Don't link to std. We are std.
114113
#![no_std]

src/libsyntax/feature_gate.rs

-6
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
7070
("tuple_indexing", Active),
7171
("associated_types", Active),
7272
("visible_private_types", Active),
73-
("slicing_syntax", Active),
7473

7574
("if_let", Active),
7675

@@ -363,11 +362,6 @@ impl<'a, 'v> Visitor<'v> for Context<'a> {
363362
self.gate_feature("if_let", e.span,
364363
"`if let` syntax is experimental");
365364
}
366-
ast::ExprSlice(..) => {
367-
self.gate_feature("slicing_syntax",
368-
e.span,
369-
"slicing syntax is experimental");
370-
}
371365
_ => {}
372366
}
373367
visit::walk_expr(self, e);

src/libsyntax/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2424
html_root_url = "http://doc.rust-lang.org/master/")]
2525

26-
#![allow(unknown_features)]
27-
#![feature(macro_rules, globs, default_type_params, phase, slicing_syntax)]
26+
#![feature(macro_rules, globs, default_type_params, phase)]
2827
#![feature(quote, struct_variant, unsafe_destructor, import_shadowing)]
2928
#![allow(deprecated)]
3029

src/libterm/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
html_root_url = "http://doc.rust-lang.org/master/",
5050
html_playground_url = "http://play.rust-lang.org/")]
5151

52-
#![allow(unknown_features)]
53-
#![feature(macro_rules, phase, slicing_syntax)]
52+
#![feature(macro_rules, phase)]
5453

5554
#![deny(missing_doc)]
5655

src/test/bench/shootout-fannkuch-redux.rs

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3939
// OF THE POSSIBILITY OF SUCH DAMAGE.
4040

41-
#![feature(slicing_syntax)]
42-
4341
use std::{cmp, iter, mem};
4442
use std::sync::Future;
4543

src/test/bench/shootout-fasta-redux.rs

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3939
// OF THE POSSIBILITY OF SUCH DAMAGE.
4040

41-
#![feature(slicing_syntax)]
42-
4341
use std::cmp::min;
4442
use std::io::{stdout, IoResult};
4543
use std::os;

src/test/bench/shootout-fasta.rs

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3939
// OF THE POSSIBILITY OF SUCH DAMAGE.
4040

41-
#![feature(slicing_syntax)]
42-
4341
use std::io;
4442
use std::io::{BufferedWriter, File};
4543
use std::cmp::min;

src/test/bench/shootout-k-nucleotide-pipes.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
// multi tasking k-nucleotide
1515

16-
#![feature(slicing_syntax)]
17-
1816
extern crate collections;
1917

2018
use std::collections::HashMap;

src/test/bench/shootout-k-nucleotide.rs

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040

4141
// ignore-android see #10393 #13206
4242

43-
#![feature(slicing_syntax)]
44-
4543
use std::string::String;
4644
use std::slice;
4745
use std::sync::{Arc, Future};

src/test/bench/shootout-regex-dna.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// ignore-stage1
4242
// ignore-cross-compile #12102
4343

44-
#![feature(macro_rules, phase, slicing_syntax)]
44+
#![feature(macro_rules, phase)]
4545

4646
extern crate regex;
4747
#[phase(plugin)]extern crate regex_macros;

src/test/bench/shootout-reverse-complement.rs

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
// ignore-pretty very bad with line comments
4242
// ignore-android doesn't terminate?
4343

44-
#![feature(slicing_syntax)]
45-
4644
use std::iter::range_step;
4745
use std::io::{stdin, stdout, File};
4846

src/test/compile-fail/issue-15730.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(slicing_syntax)]
12-
1311
fn main() {
1412
let mut array = [1, 2, 3];
1513
//~^ ERROR cannot determine a type for this local variable: cannot determine the type of this integ

src/test/compile-fail/slice-2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// Test that slicing syntax gives errors if we have not implemented the trait.
1212

13-
#![feature(slicing_syntax)]
14-
1513
struct Foo;
1614

1715
fn main() {

0 commit comments

Comments
 (0)