]> git.lizzy.rs Git - rust.git/commitdiff
Update/delete tests using @[].
authorHuon Wilson <dbau.pp+github@gmail.com>
Sat, 1 Feb 2014 04:52:41 +0000 (15:52 +1100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Sat, 1 Feb 2014 15:59:03 +0000 (02:59 +1100)
21 files changed:
src/test/compile-fail/auto-ref-slice-plus-ref.rs
src/test/compile-fail/drop-on-non-struct.rs
src/test/compile-fail/evec-subtyping.rs
src/test/compile-fail/issue-10487.rs
src/test/compile-fail/lint-heap-memory.rs
src/test/compile-fail/moves-based-on-type-exprs.rs
src/test/debug-info/boxed-vec.rs
src/test/run-pass/auto-encode.rs
src/test/run-pass/auto-ref-slice-plus-ref.rs
src/test/run-pass/borrowck-borrow-from-at-vec.rs [deleted file]
src/test/run-pass/expr-repeat-vstore.rs
src/test/run-pass/issue-5926.rs [deleted file]
src/test/run-pass/issue-9382.rs
src/test/run-pass/nullable-pointer-iotareduction.rs
src/test/run-pass/nullable-pointer-size.rs
src/test/run-pass/packed-struct-generic-size.rs
src/test/run-pass/reflect-visit-data.rs
src/test/run-pass/regions-borrow-evec-at.rs [deleted file]
src/test/run-pass/repeated-vector-syntax.rs
src/test/run-pass/vec-matching-autoslice.rs
src/test/run-pass/vec-to_str.rs

index 311becc63eff192d5cbea3227e0cd383f5d1b218..6a0f5a39202a99d734fac887da39c46ee13708a1 100644 (file)
@@ -17,7 +17,7 @@ fn main() {
     // reference.  That would allow creating a mutable pointer to a
     // temporary, which would be a source of confusion
 
-    let mut a = @[0];
+    let mut a = ~[0];
     a.test_mut(); //~ ERROR does not implement any method in scope named `test_mut`
 }
 
index ff901f986e68d5891755726ddf5026c31214622d..0d01fe4e8c73204a83c8ae258f3f395e1b847021 100644 (file)
@@ -10,7 +10,7 @@
 
 #[feature(managed_boxes)];
 
-type Foo = @[u8];
+type Foo = ~[u8];
 
 impl Drop for Foo {   //~ ERROR the Drop trait may only be implemented
 //~^ ERROR cannot provide an extension implementation
index da324e1dc202ec66c999bb1d5f98ba14199b7d82..9a0227b7d31a21013b2e99431030fad8afdf02f4 100644 (file)
 
 #[feature(managed_boxes)];
 
-fn wants_box(x: @[uint]) { }
 fn wants_uniq(x: ~[uint]) { }
 fn wants_three(x: [uint, ..3]) { }
 
-fn has_box(x: @[uint]) {
-   wants_box(x);
-   wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `@`
-   wants_three(x); //~ ERROR [] storage differs: expected `3` but found `@`
-}
-
 fn has_uniq(x: ~[uint]) {
-   wants_box(x); //~ ERROR [] storage differs: expected `@` but found `~`
    wants_uniq(x);
    wants_three(x); //~ ERROR [] storage differs: expected `3` but found `~`
 }
 
 fn has_three(x: [uint, ..3]) {
-   wants_box(x); //~ ERROR [] storage differs: expected `@` but found `3`
    wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `3`
    wants_three(x);
 }
 
 fn has_four(x: [uint, ..4]) {
-   wants_box(x); //~ ERROR [] storage differs: expected `@` but found `4`
    wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `4`
    wants_three(x); //~ ERROR [] storage differs: expected `3` but found `4`
 }
index 302e883942e6cc0f36c22e13a35d9d118dba715a..3fc6106f7480b6455dc4489b50e8194ed0c3b285 100644 (file)
@@ -11,6 +11,5 @@
 #[feature(managed_boxes)];
 
 static x: ~[int] = ~[123, 456]; //~ ERROR: cannot allocate vectors in constant expressions
-static y: @[int] = @[123, 456]; //~ ERROR: cannot allocate vectors in constant expressions
 
 fn main() {}
index 5e8c83558fb9e4a481891d2431ef42bec5b9c74f..8899f3f5dbbcfd1b986342ab39c2295c2827422b 100644 (file)
@@ -22,8 +22,7 @@ fn main() {
     let _x : Bar = Bar {x : ~10}; //~ ERROR type uses owned
 
     @2; //~ ERROR type uses managed
-    @[1]; //~ ERROR type uses managed
-    //~^ ERROR type uses managed
+
     fn f(_: @Clone) {} //~ ERROR type uses managed
 
     ~2; //~ ERROR type uses owned
index 34e506ed015c828df0fa670c797914ba22e211ec..4e2391ea25ff2dd54c86c89f838bc8c28131f85d 100644 (file)
@@ -72,12 +72,6 @@ fn f80() {
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
-fn f90() {
-    let x = ~"hi";
-    let _y = @[x];
-    touch(&x); //~ ERROR use of moved value: `x`
-}
-
 fn f100() {
     let x = ~[~"hi"];
     let _y = x[0];
index d7756c00dabbd359cfc06ed793ffd91a5200a422..2c0edb783f830ff0f0a5884d571faefbb593ed3f 100644 (file)
 // debugger:run
 // debugger:finish
 
-// debugger:print managed->val.fill
-// check:$1 = 24
-// debugger:print *((uint64_t[3]*)(managed->val.elements))
-// check:$2 = {7, 8, 9}
-
 // debugger:print unique->fill
-// check:$3 = 32
+// check:$1 = 32
 // debugger:print *((uint64_t[4]*)(unique->elements))
-// check:$4 = {10, 11, 12, 13}
+// check:$2 = {10, 11, 12, 13}
 
 #[allow(unused_variable)];
 
 fn main() {
 
-    let managed: @[i64] = @[7, 8, 9];
     let unique: ~[i64] = ~[10, 11, 12, 13];
 
     zzz();
index 5f697b7e5144001b26953cb5dfc28ca0c96874f6..f3af7d652cde49b3757e5dda74b9823d92b9b76f 100644 (file)
@@ -144,9 +144,6 @@ pub fn main() {
     let a = &Point {x: 3u, y: 5u};
     test_ebml(a);
 
-    let a = &@[1u, 2u, 3u];
-    test_ebml(a);
-
     let a = &Top(22u);
     test_ebml(a);
 
index 7bcf98c3f41bcbd4b29bcc218fec87991552a9f0..c22e25e5d95be099d257932b7f5a524857bafcbf 100644 (file)
@@ -30,7 +30,6 @@ pub fn main() {
 
     ([1]).test_imm();
     (~[1]).test_imm();
-    (@[1]).test_imm();
     (&[1]).test_imm();
     ("test").test_imm();
     (~"test").test_imm();
diff --git a/src/test/run-pass/borrowck-borrow-from-at-vec.rs b/src/test/run-pass/borrowck-borrow-from-at-vec.rs
deleted file mode 100644 (file)
index 5ae959e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#[feature(managed_boxes)];
-
-fn sum_slice(x: &[int]) -> int {
-    let mut sum = 0;
-    for i in x.iter() { sum += *i; }
-    return sum;
-}
-
-pub fn main() {
-    let x = @[1, 2, 3];
-    assert_eq!(sum_slice(x), 6);
-}
index 28fd5dbfa8dec2561f2366aafc344c7367037d3c..c841297e19f2f2f357f367e80f452314254590b0 100644 (file)
@@ -7,10 +7,4 @@ pub fn main() {
     println!("{}", v[2]);
     println!("{}", v[3]);
     println!("{}", v[4]);
-    let v: @[int] = @[ 2, ..5 ];
-    println!("{}", v[0]);
-    println!("{}", v[1]);
-    println!("{}", v[2]);
-    println!("{}", v[3]);
-    println!("{}", v[4]);
 }
diff --git a/src/test/run-pass/issue-5926.rs b/src/test/run-pass/issue-5926.rs
deleted file mode 100644 (file)
index ffb7a0a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#[feature(managed_boxes)];
-#[allow(unused_mut)];
-
-pub fn main() {
-    let  mut your_favorite_numbers = @[1,2,3];
-    let  mut my_favorite_numbers = @[4,5,6];
-    let  f = your_favorite_numbers + my_favorite_numbers;
-    println!("The third favorite number is {:?}.", f)
-}
-
index f6bbd8ebef86a68931626115809893873bafa1a3..c5123f23116251c9af2b6e91d95d37404a345c3f 100644 (file)
@@ -35,10 +35,6 @@ pub fn main() {
         baz: ~[],
         bar: ~32,
     };
-    let _t1_at = Thing1 {
-        baz: @[],
-        bar: ~32,
-    };
     let _t2_fixed = Thing2 {
         baz: &[],
         bar: 32,
@@ -47,8 +43,4 @@ pub fn main() {
         baz: ~[],
         bar: 32,
     };
-    let _t2_at = Thing2 {
-        baz: @[],
-        bar: 32,
-    };
 }
index 32803283bf94096e69dd518fb3195e9f30613487..7d8d5d635f904724e7bce6b064b8a6a69293296f 100644 (file)
@@ -80,8 +80,6 @@ pub fn main() {
     check_type!(@19: @int);
     check_type!(~"foo": ~str);
     check_type!(~[20, 22]: ~[int]);
-    check_type!(@[]: @[int]);
-    check_type!(@[24, 26]: @[int]);
     let mint: uint = unsafe { cast::transmute(main) };
     check_type!(main: extern fn(), |pthing| {
         assert!(mint == unsafe { cast::transmute(*pthing) })
index 5117d0849fb97b9d2a944ef33089df71b63c7551..84a6baa5de8a9996f887a69f3c779c40459afcbf 100644 (file)
@@ -42,6 +42,5 @@ pub fn main() {
     check_type!(@int);
     check_type!(~str);
     check_type!(~[int]);
-    check_type!(@[int]);
     check_type!(extern fn());
 }
index cba923ef646f8ec83945fe672fa477a3fc16697d..0b6ab579e6b73299fdc5acfe5b37c55d353aeaff 100644 (file)
@@ -22,6 +22,6 @@ pub fn main() {
 
     assert_eq!(mem::size_of::<S<u64, u16>>(), 11);
 
-    assert_eq!(mem::size_of::<S<~str, @[int]>>(),
-               1 + mem::size_of::<~str>() + mem::size_of::<@[int]>());
+    assert_eq!(mem::size_of::<S<~str, ~[int]>>(),
+               1 + mem::size_of::<~str>() + mem::size_of::<~[int]>());
 }
index 38000a43518b4c4bb5e1478846f3133c2945415c..6a817bf03d40180c3e9c724981cdfd7b4851bc44 100644 (file)
@@ -252,9 +252,6 @@ fn visit_vec(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
     }
 
     fn visit_evec_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<@[u8]>();
-        if ! self.inner().visit_evec_box(mtbl, inner) { return false; }
-        self.bump_past::<@[u8]>();
         true
     }
 
diff --git a/src/test/run-pass/regions-borrow-evec-at.rs b/src/test/run-pass/regions-borrow-evec-at.rs
deleted file mode 100644 (file)
index 3c0fcba..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#[feature(managed_boxes)];
-
-fn foo(x: &[uint]) -> uint {
-    x[0]
-}
-
-pub fn main() {
-    let p = @[22u];
-    let r = foo(p);
-    assert_eq!(r, 22u);
-}
index 03497de0d554fb725af20e22a2ca25377027b1b7..9f2069908437b96e7cf30b2e02c6d0b21ffecb42 100644 (file)
@@ -16,7 +16,7 @@ struct Foo {
 }
 
 pub fn main() {
-    let x = [ @[true], ..512 ];
+    let x = [ [true], ..512 ];
     let y = [ 0, ..1 ];
 
     error!("{:?}", x);
index cd9d9603ffb1ed0fdf029788429e8dea8e9b2e22..68d2ce364631c6f6aee1435722987a90394c1839 100644 (file)
@@ -1,7 +1,5 @@
-#[feature(managed_boxes)];
-
 pub fn main() {
-    let x = @[1, 2, 3];
+    let x = ~[1, 2, 3];
     match x {
         [2, ..] => fail!(),
         [1, ..tail] => {
index 16a895f7231621542076dfb4326d447eb4a92de2..e25b4de0a11c9dc019a06a126e344843eddbdcca 100644 (file)
@@ -8,19 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[feature(managed_boxes)];
-
 pub fn main() {
     assert_eq!((~[0, 1]).to_str(), ~"[0, 1]");
     assert_eq!((&[1, 2]).to_str(), ~"[1, 2]");
-    assert_eq!((@[2, 3]).to_str(), ~"[2, 3]");
 
     let foo = ~[3, 4];
     let bar = &[4, 5];
-    let baz = @[5, 6];
 
     assert_eq!(foo.to_str(), ~"[3, 4]");
     assert_eq!(bar.to_str(), ~"[4, 5]");
-    assert_eq!(baz.to_str(), ~"[5, 6]");
-
 }