diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-06-09 01:04:58 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-06-15 19:18:09 +0200 |
| commit | 05dc86488067fd62b602a2cbbf566fed67f4e0ff (patch) | |
| tree | e8e0ef777949e4f5b77ef76432317167846b4fc2 /src/test/run-pass | |
| parent | e5060da781d4deea3b7caf81c30b72e1838fcb39 (diff) | |
Move type_alias_enum_variants tests to a folder; Strip feature gates.
Diffstat (limited to 'src/test/run-pass')
| -rw-r--r-- | src/test/run-pass/type-alias-enum-variants-2.rs | 30 | ||||
| -rw-r--r-- | src/test/run-pass/type-alias-enum-variants.rs | 30 |
2 files changed, 0 insertions, 60 deletions
diff --git a/src/test/run-pass/type-alias-enum-variants-2.rs b/src/test/run-pass/type-alias-enum-variants-2.rs deleted file mode 100644 index 0cf413babcb..00000000000 --- a/src/test/run-pass/type-alias-enum-variants-2.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![feature(type_alias_enum_variants)] - -#[derive(Debug, PartialEq, Eq)] -enum Foo { - Bar(i32), - Baz { i: i32 }, -} - -type FooAlias = Foo; -type OptionAlias = Option<i32>; - -impl Foo { - fn foo() -> Self { - Self::Bar(3) - } -} - -fn main() { - let t = FooAlias::Bar(1); - assert_eq!(t, Foo::Bar(1)); - let t = FooAlias::Baz { i: 2 }; - assert_eq!(t, Foo::Baz { i: 2 }); - match t { - FooAlias::Bar(_i) => {} - FooAlias::Baz { i } => { assert_eq!(i, 2); } - } - assert_eq!(Foo::foo(), Foo::Bar(3)); - - assert_eq!(OptionAlias::Some(4), Option::Some(4)); -} diff --git a/src/test/run-pass/type-alias-enum-variants.rs b/src/test/run-pass/type-alias-enum-variants.rs deleted file mode 100644 index 0cf413babcb..00000000000 --- a/src/test/run-pass/type-alias-enum-variants.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![feature(type_alias_enum_variants)] - -#[derive(Debug, PartialEq, Eq)] -enum Foo { - Bar(i32), - Baz { i: i32 }, -} - -type FooAlias = Foo; -type OptionAlias = Option<i32>; - -impl Foo { - fn foo() -> Self { - Self::Bar(3) - } -} - -fn main() { - let t = FooAlias::Bar(1); - assert_eq!(t, Foo::Bar(1)); - let t = FooAlias::Baz { i: 2 }; - assert_eq!(t, Foo::Baz { i: 2 }); - match t { - FooAlias::Bar(_i) => {} - FooAlias::Baz { i } => { assert_eq!(i, 2); } - } - assert_eq!(Foo::foo(), Foo::Bar(3)); - - assert_eq!(OptionAlias::Some(4), Option::Some(4)); -} |
