diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-05-05 18:56:44 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-05-06 23:12:54 -0700 |
| commit | 090040bf4037a094e50b03d79e4baf5cd89c912b (patch) | |
| tree | 27fa91d623889d59260d3db167abdfa8c4288849 /src/test/compile-fail/borrowck-vec-pattern-nesting.rs | |
| parent | 24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff) | |
| download | rust-090040bf4037a094e50b03d79e4baf5cd89c912b.tar.gz rust-090040bf4037a094e50b03d79e4baf5cd89c912b.zip | |
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
Diffstat (limited to 'src/test/compile-fail/borrowck-vec-pattern-nesting.rs')
| -rw-r--r-- | src/test/compile-fail/borrowck-vec-pattern-nesting.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs index 7f0a6c84f8c..f41f74b166f 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs @@ -8,28 +8,29 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. + fn a() { - let mut vec = [~1, ~2, ~3]; + let mut vec = [box 1, box 2, box 3]; match vec { - [~ref _a, _, _] => { - vec[0] = ~4; //~ ERROR cannot assign + [box ref _a, _, _] => { + vec[0] = box 4; //~ ERROR cannot assign } } } fn b() { - let mut vec = vec!(~1, ~2, ~3); - let vec: &mut [~int] = vec.as_mut_slice(); + let mut vec = vec!(box 1, box 2, box 3); + let vec: &mut [Box<int>] = vec.as_mut_slice(); match vec { [.._b] => { - vec[0] = ~4; //~ ERROR cannot assign + vec[0] = box 4; //~ ERROR cannot assign } } } fn c() { - let mut vec = vec!(~1, ~2, ~3); - let vec: &mut [~int] = vec.as_mut_slice(); + let mut vec = vec!(box 1, box 2, box 3); + let vec: &mut [Box<int>] = vec.as_mut_slice(); match vec { [_a, //~ ERROR cannot move out .._b] => { //~^ NOTE attempting to move value to here @@ -46,8 +47,8 @@ fn c() { } fn d() { - let mut vec = vec!(~1, ~2, ~3); - let vec: &mut [~int] = vec.as_mut_slice(); + let mut vec = vec!(box 1, box 2, box 3); + let vec: &mut [Box<int>] = vec.as_mut_slice(); match vec { [.._a, //~ ERROR cannot move out _b] => {} //~ NOTE attempting to move value to here @@ -57,8 +58,8 @@ fn d() { } fn e() { - let mut vec = vec!(~1, ~2, ~3); - let vec: &mut [~int] = vec.as_mut_slice(); + let mut vec = vec!(box 1, box 2, box 3); + let vec: &mut [Box<int>] = vec.as_mut_slice(); match vec { [_a, _b, _c] => {} //~ ERROR cannot move out //~^ NOTE attempting to move value to here |
