Move type_alias_enum_variants tests to a folder; Strip feature gates.
This commit is contained in:
parent
e5060da781
commit
05dc864880
@ -1,7 +1,5 @@
|
||||
// run-pass
|
||||
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
#![allow(irrefutable_let_patterns)]
|
||||
|
||||
#[allow(dead_code)]
|
@ -1,5 +1,3 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
enum Enum<T> { TSVariant(T), SVariant { v: T } }
|
||||
type Alias<T> = Enum<T>;
|
||||
type AliasFixed = Enum<()>;
|
@ -1,5 +1,5 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/enum-variant-generic-args.rs:9:25
|
||||
--> $DIR/enum-variant-generic-args.rs:7:25
|
||||
|
|
||||
LL | Self::TSVariant(());
|
||||
| ^^ expected type parameter, found ()
|
||||
@ -8,19 +8,19 @@ LL | Self::TSVariant(());
|
||||
found type `()`
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:11:27
|
||||
--> $DIR/enum-variant-generic-args.rs:9:27
|
||||
|
|
||||
LL | Self::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:13:16
|
||||
--> $DIR/enum-variant-generic-args.rs:11:16
|
||||
|
|
||||
LL | Self::<()>::TSVariant(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/enum-variant-generic-args.rs:13:31
|
||||
--> $DIR/enum-variant-generic-args.rs:11:31
|
||||
|
|
||||
LL | Self::<()>::TSVariant(());
|
||||
| ^^ expected type parameter, found ()
|
||||
@ -29,19 +29,19 @@ LL | Self::<()>::TSVariant(());
|
||||
found type `()`
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:16:16
|
||||
--> $DIR/enum-variant-generic-args.rs:14:16
|
||||
|
|
||||
LL | Self::<()>::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:16:33
|
||||
--> $DIR/enum-variant-generic-args.rs:14:33
|
||||
|
|
||||
LL | Self::<()>::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/enum-variant-generic-args.rs:22:29
|
||||
--> $DIR/enum-variant-generic-args.rs:20:29
|
||||
|
|
||||
LL | Self::SVariant { v: () };
|
||||
| ^^ expected type parameter, found ()
|
||||
@ -50,13 +50,13 @@ LL | Self::SVariant { v: () };
|
||||
found type `()`
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:24:26
|
||||
--> $DIR/enum-variant-generic-args.rs:22:26
|
||||
|
|
||||
LL | Self::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/enum-variant-generic-args.rs:24:35
|
||||
--> $DIR/enum-variant-generic-args.rs:22:35
|
||||
|
|
||||
LL | Self::SVariant::<()> { v: () };
|
||||
| ^^ expected type parameter, found ()
|
||||
@ -65,13 +65,13 @@ LL | Self::SVariant::<()> { v: () };
|
||||
found type `()`
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:27:16
|
||||
--> $DIR/enum-variant-generic-args.rs:25:16
|
||||
|
|
||||
LL | Self::<()>::SVariant { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/enum-variant-generic-args.rs:27:35
|
||||
--> $DIR/enum-variant-generic-args.rs:25:35
|
||||
|
|
||||
LL | Self::<()>::SVariant { v: () };
|
||||
| ^^ expected type parameter, found ()
|
||||
@ -80,19 +80,19 @@ LL | Self::<()>::SVariant { v: () };
|
||||
found type `()`
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:30:16
|
||||
--> $DIR/enum-variant-generic-args.rs:28:16
|
||||
|
|
||||
LL | Self::<()>::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:30:32
|
||||
--> $DIR/enum-variant-generic-args.rs:28:32
|
||||
|
|
||||
LL | Self::<()>::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/enum-variant-generic-args.rs:30:41
|
||||
--> $DIR/enum-variant-generic-args.rs:28:41
|
||||
|
|
||||
LL | Self::<()>::SVariant::<()> { v: () };
|
||||
| ^^ expected type parameter, found ()
|
||||
@ -101,85 +101,85 @@ LL | Self::<()>::SVariant::<()> { v: () };
|
||||
found type `()`
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:40:29
|
||||
--> $DIR/enum-variant-generic-args.rs:38:29
|
||||
|
|
||||
LL | Enum::<()>::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:43:24
|
||||
--> $DIR/enum-variant-generic-args.rs:41:24
|
||||
|
|
||||
LL | Alias::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:45:30
|
||||
--> $DIR/enum-variant-generic-args.rs:43:30
|
||||
|
|
||||
LL | Alias::<()>::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:48:29
|
||||
--> $DIR/enum-variant-generic-args.rs:46:29
|
||||
|
|
||||
LL | AliasFixed::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0107]: wrong number of type arguments: expected 0, found 1
|
||||
--> $DIR/enum-variant-generic-args.rs:50:18
|
||||
--> $DIR/enum-variant-generic-args.rs:48:18
|
||||
|
|
||||
LL | AliasFixed::<()>::TSVariant(());
|
||||
| ^^ unexpected type argument
|
||||
|
||||
error[E0107]: wrong number of type arguments: expected 0, found 1
|
||||
--> $DIR/enum-variant-generic-args.rs:52:18
|
||||
--> $DIR/enum-variant-generic-args.rs:50:18
|
||||
|
|
||||
LL | AliasFixed::<()>::TSVariant::<()>(());
|
||||
| ^^ unexpected type argument
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:52:35
|
||||
--> $DIR/enum-variant-generic-args.rs:50:35
|
||||
|
|
||||
LL | AliasFixed::<()>::TSVariant::<()>(());
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:58:28
|
||||
--> $DIR/enum-variant-generic-args.rs:56:28
|
||||
|
|
||||
LL | Enum::<()>::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:61:23
|
||||
--> $DIR/enum-variant-generic-args.rs:59:23
|
||||
|
|
||||
LL | Alias::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:63:29
|
||||
--> $DIR/enum-variant-generic-args.rs:61:29
|
||||
|
|
||||
LL | Alias::<()>::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:66:28
|
||||
--> $DIR/enum-variant-generic-args.rs:64:28
|
||||
|
|
||||
LL | AliasFixed::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
||||
|
||||
error[E0107]: wrong number of type arguments: expected 0, found 1
|
||||
--> $DIR/enum-variant-generic-args.rs:68:18
|
||||
--> $DIR/enum-variant-generic-args.rs:66:18
|
||||
|
|
||||
LL | AliasFixed::<()>::SVariant { v: () };
|
||||
| ^^ unexpected type argument
|
||||
|
||||
error[E0107]: wrong number of type arguments: expected 0, found 1
|
||||
--> $DIR/enum-variant-generic-args.rs:70:18
|
||||
--> $DIR/enum-variant-generic-args.rs:68:18
|
||||
|
|
||||
LL | AliasFixed::<()>::SVariant::<()> { v: () };
|
||||
| ^^ unexpected type argument
|
||||
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/enum-variant-generic-args.rs:70:34
|
||||
--> $DIR/enum-variant-generic-args.rs:68:34
|
||||
|
|
||||
LL | AliasFixed::<()>::SVariant::<()> { v: () };
|
||||
| ^^ type argument not allowed
|
@ -1,7 +1,5 @@
|
||||
// compile-pass
|
||||
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
enum Outer<T> {
|
||||
A(T)
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
pub enum Enum {
|
||||
A(usize),
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
error[E0533]: expected unit struct/variant or constant, found tuple variant `<Self>::A`
|
||||
--> $DIR/issue-58006.rs:9:13
|
||||
--> $DIR/issue-58006.rs:8:13
|
||||
|
|
||||
LL | Self::A => (),
|
||||
| ^^^^^^^
|
@ -3,8 +3,6 @@
|
||||
|
||||
// compile-pass
|
||||
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
enum Opt<T> {
|
||||
N,
|
||||
S(T),
|
||||
|
@ -1,7 +1,5 @@
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
#![allow(unreachable_code)]
|
||||
|
||||
enum Enum { Variant {} }
|
@ -1,17 +1,17 @@
|
||||
error[E0533]: expected unit struct/variant or constant, found struct variant `<Alias>::Variant`
|
||||
--> $DIR/type-alias-enum-variants-panic.rs:11:5
|
||||
--> $DIR/type-alias-enum-variants-panic.rs:9:5
|
||||
|
|
||||
LL | Alias::Variant;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error[E0533]: expected unit struct/variant or constant, found struct variant `<Alias>::Variant`
|
||||
--> $DIR/type-alias-enum-variants-panic.rs:13:9
|
||||
--> $DIR/type-alias-enum-variants-panic.rs:11:9
|
||||
|
|
||||
LL | let Alias::Variant = panic!();
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error[E0164]: expected tuple struct/variant, found struct variant `<Alias>::Variant`
|
||||
--> $DIR/type-alias-enum-variants-panic.rs:15:9
|
||||
--> $DIR/type-alias-enum-variants-panic.rs:13:9
|
||||
|
|
||||
LL | let Alias::Variant(..) = panic!();
|
||||
| ^^^^^^^^^^^^^^^^^^ not a tuple variant or struct
|
@ -1,4 +1,4 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
// run-pass
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
enum Foo {
|
@ -1,4 +1,4 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
// run-pass
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
enum Foo {
|
@ -1,5 +1,3 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
enum E {
|
||||
V(u8)
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
error[E0061]: this function takes 1 parameter but 0 parameters were supplied
|
||||
--> $DIR/type-alias-enum-variants-priority-2.rs:12:5
|
||||
--> $DIR/type-alias-enum-variants-priority-2.rs:10:5
|
||||
|
|
||||
LL | V(u8)
|
||||
| ----- defined here
|
@ -1,5 +1,3 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
enum E {
|
||||
V
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
error: expected type, found variant `V`
|
||||
--> $DIR/type-alias-enum-variants-priority-3.rs:7:15
|
||||
--> $DIR/type-alias-enum-variants-priority-3.rs:5:15
|
||||
|
|
||||
LL | fn check() -> <E>::V {}
|
||||
| ^^^^^^
|
@ -1,5 +1,3 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
enum E {
|
||||
V
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
error: ambiguous associated item
|
||||
--> $DIR/type-alias-enum-variants-priority.rs:14:15
|
||||
--> $DIR/type-alias-enum-variants-priority.rs:12:15
|
||||
|
|
||||
LL | fn f() -> Self::V { 0 }
|
||||
| ^^^^^^^ help: use fully-qualified syntax: `<E as Trait>::V`
|
||||
@ -8,12 +8,12 @@ LL | fn f() -> Self::V { 0 }
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #57644 <https://github.com/rust-lang/rust/issues/57644>
|
||||
note: `V` could refer to variant defined here
|
||||
--> $DIR/type-alias-enum-variants-priority.rs:4:5
|
||||
--> $DIR/type-alias-enum-variants-priority.rs:2:5
|
||||
|
|
||||
LL | V
|
||||
| ^
|
||||
note: `V` could also refer to associated type defined here
|
||||
--> $DIR/type-alias-enum-variants-priority.rs:8:5
|
||||
--> $DIR/type-alias-enum-variants-priority.rs:6:5
|
||||
|
|
||||
LL | type V;
|
||||
| ^^^^^^^
|
@ -1,5 +1,3 @@
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
type Alias<T> = Option<T>;
|
||||
|
||||
fn main() {
|
@ -1,5 +1,5 @@
|
||||
error[E0109]: type arguments are not allowed for this type
|
||||
--> $DIR/type-alias-enum-variants.rs:9:27
|
||||
--> $DIR/type-alias-enum-variants.rs:7:27
|
||||
|
|
||||
LL | let _ = Alias::None::<u8>; // Error
|
||||
| ^^ type argument not allowed
|
Loading…
x
Reference in New Issue
Block a user