diff options
| author | bors <bors@rust-lang.org> | 2014-01-03 12:16:48 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-03 12:16:48 -0800 |
| commit | 08321f1c49d75e60a2c56320a3f1483e7bf79a91 (patch) | |
| tree | fd429cf0c3cd63379bef08c36fd9acf0f3e0d82a /src/test | |
| parent | 11ce6b709ace233e473eddb26e3e23c2c4c16cdd (diff) | |
| parent | 4bea679dbe3ba98049ac700d84ad48271753ce40 (diff) | |
| download | rust-08321f1c49d75e60a2c56320a3f1483e7bf79a91.tar.gz rust-08321f1c49d75e60a2c56320a3f1483e7bf79a91.zip | |
auto merge of #11149 : alexcrichton/rust/remove-either, r=brson
Had to change some stuff in typeck to bootstrap (getting methods in fmt off of Either), but other than that not so painful. Closes #9157
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/borrowck-autoref-3261.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-5358-1.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-5358.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/lint-unused-imports.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/issue-6117.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/small-enums-with-fields.rs | 3 |
7 files changed, 12 insertions, 5 deletions
diff --git a/src/test/compile-fail/borrowck-autoref-3261.rs b/src/test/compile-fail/borrowck-autoref-3261.rs index 5c7e328969b..1bd791ad5e0 100644 --- a/src/test/compile-fail/borrowck-autoref-3261.rs +++ b/src/test/compile-fail/borrowck-autoref-3261.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +enum Either<T, U> { Left(T), Right(U) } + struct X(Either<(uint,uint),extern fn()>); impl X { diff --git a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs index e2136c82313..300efbbc4fa 100644 --- a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs +++ b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::either::{Either, Left, Right}; +enum Either<T, U> { Left(T), Right(U) } fn f(x: &mut Either<int,f64>, y: &Either<int,f64>) -> int { match *y { diff --git a/src/test/compile-fail/issue-5358-1.rs b/src/test/compile-fail/issue-5358-1.rs index a3d25e7d2ad..326d2e1c852 100644 --- a/src/test/compile-fail/issue-5358-1.rs +++ b/src/test/compile-fail/issue-5358-1.rs @@ -8,11 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +enum Either<T, U> { Left(T), Right(U) } struct S(Either<uint, uint>); fn main() { match S(Left(5)) { - Right(_) => {} //~ ERROR mismatched types: expected `S` but found `std::either::Either + Right(_) => {} //~ ERROR mismatched types: expected `S` but found `Either _ => {} } } diff --git a/src/test/compile-fail/issue-5358.rs b/src/test/compile-fail/issue-5358.rs index 8d4f4633466..b9540fe2cf0 100644 --- a/src/test/compile-fail/issue-5358.rs +++ b/src/test/compile-fail/issue-5358.rs @@ -8,10 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +enum Either<T, U> { Left(T), Right(U) } struct S(Either<uint, uint>); fn main() { match *S(Left(5)) { - S(_) => {} //~ ERROR mismatched types: expected `std::either::Either<uint,uint>` but found a structure pattern + S(_) => {} //~ ERROR mismatched types: expected `Either<uint,uint>` but found a structure pattern } } diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs index e248184d5e2..c7565fa0169 100644 --- a/src/test/compile-fail/lint-unused-imports.rs +++ b/src/test/compile-fail/lint-unused-imports.rs @@ -14,8 +14,6 @@ use cal = bar::c::cc; -use std::either::Right; //~ ERROR unused import - use std::util::*; // shouldn't get errors for not using // everything imported diff --git a/src/test/run-pass/issue-6117.rs b/src/test/run-pass/issue-6117.rs index 6b68e3c9ed7..400486b2f22 100644 --- a/src/test/run-pass/issue-6117.rs +++ b/src/test/run-pass/issue-6117.rs @@ -10,6 +10,8 @@ #[feature(managed_boxes)]; +enum Either<T, U> { Left(T), Right(U) } + pub fn main() { match Left(@17) { Right(()) => {} diff --git a/src/test/run-pass/small-enums-with-fields.rs b/src/test/run-pass/small-enums-with-fields.rs index c4f4b5e4e37..06b536b8391 100644 --- a/src/test/run-pass/small-enums-with-fields.rs +++ b/src/test/run-pass/small-enums-with-fields.rs @@ -12,6 +12,9 @@ use std::mem::size_of; +#[deriving(Eq)] +enum Either<T, U> { Left(T), Right(U) } + macro_rules! check { ($t:ty, $sz:expr, $($e:expr, $s:expr),*) => {{ assert_eq!(size_of::<$t>(), $sz); |
