Put slicing syntax behind a feature gate.

[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
This commit is contained in:
Nick Cameron 2014-09-26 17:48:16 +12:00
parent df2f1fa768
commit 95cfc35607
43 changed files with 105 additions and 43 deletions

View file

@ -38,6 +38,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(slicing_syntax)]
use std::{cmp, iter, mem};
use std::sync::Future;

View file

@ -38,6 +38,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(slicing_syntax)]
use std::cmp::min;
use std::io::{stdout, IoResult};
use std::os;

View file

@ -38,6 +38,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(slicing_syntax)]
use std::io;
use std::io::{BufferedWriter, File};
use std::cmp::min;

View file

@ -13,6 +13,8 @@
// multi tasking k-nucleotide
#![feature(slicing_syntax)]
extern crate collections;
use std::collections::HashMap;

View file

@ -40,6 +40,8 @@
// ignore-android see #10393 #13206
#![feature(slicing_syntax)]
use std::string::String;
use std::slice;
use std::sync::{Arc, Future};

View file

@ -41,7 +41,7 @@
// ignore-stage1
// ignore-cross-compile #12102
#![feature(macro_rules, phase)]
#![feature(macro_rules, phase, slicing_syntax)]
extern crate regex;
#[phase(plugin)]extern crate regex_macros;

View file

@ -41,6 +41,8 @@
// ignore-pretty very bad with line comments
// ignore-android doesn't terminate?
#![feature(slicing_syntax)]
use std::iter::range_step;
use std::io::{stdin, stdout, File};

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(slicing_syntax)]
fn main() {
let mut array = [1, 2, 3];
//~^ ERROR cannot determine a type for this local variable: cannot determine the type of this integ

View file

@ -10,6 +10,8 @@
// Test that slicing syntax gives errors if we have not implemented the trait.
#![feature(slicing_syntax)]
struct Foo;
fn main() {

View file

@ -10,6 +10,8 @@
// Test slicing expressions doesn't defeat the borrow checker.
#![feature(slicing_syntax)]
fn main() {
let y;
{

View file

@ -10,6 +10,8 @@
// Test mutability and slicing syntax.
#![feature(slicing_syntax)]
fn main() {
let x: &[int] = &[1, 2, 3, 4, 5];
// Can't mutably slice an immutable slice

View file

@ -10,6 +10,8 @@
// Test mutability and slicing syntax.
#![feature(slicing_syntax)]
fn main() {
let x: &[int] = &[1, 2, 3, 4, 5];
// Immutable slices are not mutable.

View file

@ -80,6 +80,7 @@
// lldb-check:[...]$5 = &[AStruct { x: 10, y: 11, z: 12 }, AStruct { x: 13, y: 14, z: 15 }]
#![allow(unused_variable)]
#![feature(slicing_syntax)]
struct AStruct {
x: i16,

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(slicing_syntax)]
fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] {
v[1..5]
}

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(slicing_syntax)]
fn broken(v: &[u8], i: uint, j: uint) -> &[u8] { v[i..j] }
pub fn main() {}

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(slicing_syntax)]
extern crate debug;

View file

@ -10,6 +10,8 @@
// Test slicing expressions on slices and Vecs.
#![feature(slicing_syntax)]
fn main() {
let x: &[int] = &[1, 2, 3, 4, 5];
let cmp: &[int] = &[1, 2, 3, 4, 5];

View file

@ -10,6 +10,8 @@
// Test that is a slicing expr[..] fails, the correct cleanups happen.
#![feature(slicing_syntax)]
use std::task;
struct Foo;

View file

@ -10,6 +10,8 @@
// Test that is a slicing expr[..] fails, the correct cleanups happen.
#![feature(slicing_syntax)]
use std::task;
struct Foo;

View file

@ -10,6 +10,8 @@
// Test slicing sugar.
#![feature(slicing_syntax)]
extern crate core;
use core::ops::{Slice,SliceMut};