type_alias_enum_variants: cleanup redundant 'allow(unused)'.
This commit is contained in:
parent
46f405ec4d
commit
57e6869a6b
@ -9,7 +9,6 @@
|
||||
|
||||
#![allow(irrefutable_let_patterns)]
|
||||
|
||||
#[allow(dead_code)]
|
||||
enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
|
||||
type Alias<T> = Enum<T>;
|
||||
type AliasFixed = Enum<()>;
|
||||
|
@ -3,8 +3,6 @@
|
||||
// Check that creating/matching on an enum variant through an alias with
|
||||
// the wrong braced/unit form is caught as an error.
|
||||
|
||||
#![allow(unreachable_code)]
|
||||
|
||||
enum Enum { Braced {}, Unit, Tuple() }
|
||||
type Alias = Enum;
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
error[E0533]: expected unit struct/variant or constant, found struct variant `<Alias>::Braced`
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:12:5
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:10:5
|
||||
|
|
||||
LL | Alias::Braced;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0533]: expected unit struct/variant or constant, found struct variant `<Alias>::Braced`
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:14:9
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:12:9
|
||||
|
|
||||
LL | let Alias::Braced = panic!();
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0164]: expected tuple struct/variant, found struct variant `<Alias>::Braced`
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:16:9
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:14:9
|
||||
|
|
||||
LL | let Alias::Braced(..) = panic!();
|
||||
| ^^^^^^^^^^^^^^^^^ not a tuple variant or struct
|
||||
|
||||
error[E0618]: expected function, found enum variant `<Alias>::Unit`
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:19:5
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:17:5
|
||||
|
|
||||
LL | enum Enum { Braced {}, Unit, Tuple() }
|
||||
| ---- `<Alias>::Unit` defined here
|
||||
@ -32,7 +32,7 @@ LL | <Alias>::Unit;
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0164]: expected tuple struct/variant, found unit variant `<Alias>::Unit`
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:21:9
|
||||
--> $DIR/incorrect-variant-form-through-alias-caught.rs:19:9
|
||||
|
|
||||
LL | let Alias::Unit() = panic!();
|
||||
| ^^^^^^^^^^^^^ not a tuple variant or struct
|
||||
|
Loading…
x
Reference in New Issue
Block a user