about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-05-06 00:42:54 -0400
committerAlex Crichton <alex@alexcrichton.com>2013-05-10 22:51:06 -0400
commit998fececd6516fa07d0cd0a0c4607ddef0bc40f0 (patch)
tree9597e6c2f0592136086f722338b95196f71104ec /src/test/compile-fail
parent7d22437ecdc5b52f8517ffde6207347739b26553 (diff)
downloadrust-998fececd6516fa07d0cd0a0c4607ddef0bc40f0.tar.gz
rust-998fececd6516fa07d0cd0a0c4607ddef0bc40f0.zip
Stop using the '<->' operator
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/liveness-assign-imm-local-in-swap.rs28
-rw-r--r--src/test/compile-fail/liveness-swap-uninit.rs16
-rw-r--r--src/test/compile-fail/moves-based-on-type-exprs.rs2
-rw-r--r--src/test/compile-fail/swap-no-lval.rs15
4 files changed, 1 insertions, 60 deletions
diff --git a/src/test/compile-fail/liveness-assign-imm-local-in-swap.rs b/src/test/compile-fail/liveness-assign-imm-local-in-swap.rs
deleted file mode 100644
index 40ccfca919b..00000000000
--- a/src/test/compile-fail/liveness-assign-imm-local-in-swap.rs
+++ /dev/null
@@ -1,28 +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.
-
-fn test1() {
-    let v: int;
-    let mut w: int;
-    v = 1; //~ NOTE prior assignment occurs here
-    w = 2;
-    v <-> w; //~ ERROR re-assignment of immutable variable
-}
-
-fn test2() {
-    let v: int;
-    let mut w: int;
-    v = 1; //~ NOTE prior assignment occurs here
-    w = 2;
-    w <-> v; //~ ERROR re-assignment of immutable variable
-}
-
-fn main() {
-}
diff --git a/src/test/compile-fail/liveness-swap-uninit.rs b/src/test/compile-fail/liveness-swap-uninit.rs
deleted file mode 100644
index b2d475dd789..00000000000
--- a/src/test/compile-fail/liveness-swap-uninit.rs
+++ /dev/null
@@ -1,16 +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.
-
-fn main() {
-    let mut x = 3;
-    let y;
-    x <-> y; //~ ERROR use of possibly uninitialized variable: `y`
-    copy x;
-}
diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs
index 7356c227360..5b733129ee5 100644
--- a/src/test/compile-fail/moves-based-on-type-exprs.rs
+++ b/src/test/compile-fail/moves-based-on-type-exprs.rs
@@ -87,7 +87,7 @@ fn f110() {
 
 fn f120() {
     let x = ~[~"hi", ~"ho"];
-    x[0] <-> x[1];
+    vec::swap(x, 0, 1);
     touch(&x[0]);
     touch(&x[1]);
 }
diff --git a/src/test/compile-fail/swap-no-lval.rs b/src/test/compile-fail/swap-no-lval.rs
deleted file mode 100644
index eca5fb0d315..00000000000
--- a/src/test/compile-fail/swap-no-lval.rs
+++ /dev/null
@@ -1,15 +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.
-
-fn main() {
-    5 <-> 3;
-    //~^ ERROR cannot assign
-    //~^^ ERROR cannot assign
-}