diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-09-26 17:48:16 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-10-07 15:49:53 +1300 |
| commit | 2d3823441fe5324f747f7bf51ffc07b9434f827f (patch) | |
| tree | cf8f7d36282f850bee8aaa73521499fe6f436f85 /src/test/compile-fail | |
| parent | 59976942eacd26c0cc37247c3ac0c78b97edc6ea (diff) | |
| download | rust-2d3823441fe5324f747f7bf51ffc07b9434f827f.tar.gz rust-2d3823441fe5324f747f7bf51ffc07b9434f827f.zip | |
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.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/issue-15730.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/slice-2.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/slice-borrow.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/slice-mut-2.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/slice-mut.rs | 2 |
5 files changed, 10 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-15730.rs b/src/test/compile-fail/issue-15730.rs index fc8c4e36075..c29e74af03c 100644 --- a/src/test/compile-fail/issue-15730.rs +++ b/src/test/compile-fail/issue-15730.rs @@ -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 diff --git a/src/test/compile-fail/slice-2.rs b/src/test/compile-fail/slice-2.rs index fbfc438321c..63f79c808ae 100644 --- a/src/test/compile-fail/slice-2.rs +++ b/src/test/compile-fail/slice-2.rs @@ -10,6 +10,8 @@ // Test that slicing syntax gives errors if we have not implemented the trait. +#![feature(slicing_syntax)] + struct Foo; fn main() { diff --git a/src/test/compile-fail/slice-borrow.rs b/src/test/compile-fail/slice-borrow.rs index 3d12511134f..00783b71ea1 100644 --- a/src/test/compile-fail/slice-borrow.rs +++ b/src/test/compile-fail/slice-borrow.rs @@ -10,6 +10,8 @@ // Test slicing expressions doesn't defeat the borrow checker. +#![feature(slicing_syntax)] + fn main() { let y; { diff --git a/src/test/compile-fail/slice-mut-2.rs b/src/test/compile-fail/slice-mut-2.rs index 1176b637cec..09019448a67 100644 --- a/src/test/compile-fail/slice-mut-2.rs +++ b/src/test/compile-fail/slice-mut-2.rs @@ -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 diff --git a/src/test/compile-fail/slice-mut.rs b/src/test/compile-fail/slice-mut.rs index 8cd7c4ed0bb..cbfa3ed85fd 100644 --- a/src/test/compile-fail/slice-mut.rs +++ b/src/test/compile-fail/slice-mut.rs @@ -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. |
