diff options
| author | bors <bors@rust-lang.org> | 2014-10-07 06:17:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-07 06:17:11 +0000 |
| commit | e62ef37cfae680e60584731635a89e955121a5bb (patch) | |
| tree | 768fd0552e75e5380b1122ac56448f0465df8fb3 /src/test/compile-fail | |
| parent | 8d702167ba6af50c64683685bae4956cb094a23a (diff) | |
| parent | eb2fdc8b065218476744ed428097c859616c62f0 (diff) | |
| download | rust-e62ef37cfae680e60584731635a89e955121a5bb.tar.gz rust-e62ef37cfae680e60584731635a89e955121a5bb.zip | |
auto merge of #17807 : nick29581/rust/slice6, r=aturon
r? @aturon
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/issue-15730.rs | 4 | ||||
| -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, 11 insertions, 1 deletions
diff --git a/src/test/compile-fail/issue-15730.rs b/src/test/compile-fail/issue-15730.rs index 6cddd8ee939..c29e74af03c 100644 --- a/src/test/compile-fail/issue-15730.rs +++ b/src/test/compile-fail/issue-15730.rs @@ -8,8 +8,10 @@ // 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 - let pie_slice = array.slice(1, 2); + let pie_slice = array[1..2]; } 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. |
