Skip to content

Commit 57e6869

Browse files
committed
type_alias_enum_variants: cleanup redundant 'allow(unused)'.
1 parent 46f405e commit 57e6869

3 files changed

+5
-8
lines changed

src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#![allow(irrefutable_let_patterns)]
1111

12-
#[allow(dead_code)]
1312
enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
1413
type Alias<T> = Enum<T>;
1514
type AliasFixed = Enum<()>;

src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// Check that creating/matching on an enum variant through an alias with
44
// the wrong braced/unit form is caught as an error.
55

6-
#![allow(unreachable_code)]
7-
86
enum Enum { Braced {}, Unit, Tuple() }
97
type Alias = Enum;
108

src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0533]: expected unit struct/variant or constant, found struct variant `<Alias>::Braced`
2-
--> $DIR/incorrect-variant-form-through-alias-caught.rs:12:5
2+
--> $DIR/incorrect-variant-form-through-alias-caught.rs:10:5
33
|
44
LL | Alias::Braced;
55
| ^^^^^^^^^^^^^
66

77
error[E0533]: expected unit struct/variant or constant, found struct variant `<Alias>::Braced`
8-
--> $DIR/incorrect-variant-form-through-alias-caught.rs:14:9
8+
--> $DIR/incorrect-variant-form-through-alias-caught.rs:12:9
99
|
1010
LL | let Alias::Braced = panic!();
1111
| ^^^^^^^^^^^^^
1212

1313
error[E0164]: expected tuple struct/variant, found struct variant `<Alias>::Braced`
14-
--> $DIR/incorrect-variant-form-through-alias-caught.rs:16:9
14+
--> $DIR/incorrect-variant-form-through-alias-caught.rs:14:9
1515
|
1616
LL | let Alias::Braced(..) = panic!();
1717
| ^^^^^^^^^^^^^^^^^ not a tuple variant or struct
1818

1919
error[E0618]: expected function, found enum variant `<Alias>::Unit`
20-
--> $DIR/incorrect-variant-form-through-alias-caught.rs:19:5
20+
--> $DIR/incorrect-variant-form-through-alias-caught.rs:17:5
2121
|
2222
LL | enum Enum { Braced {}, Unit, Tuple() }
2323
| ---- `<Alias>::Unit` defined here
@@ -32,7 +32,7 @@ LL | <Alias>::Unit;
3232
| ^^^^^^^^^^^^^
3333

3434
error[E0164]: expected tuple struct/variant, found unit variant `<Alias>::Unit`
35-
--> $DIR/incorrect-variant-form-through-alias-caught.rs:21:9
35+
--> $DIR/incorrect-variant-form-through-alias-caught.rs:19:9
3636
|
3737
LL | let Alias::Unit() = panic!();
3838
| ^^^^^^^^^^^^^ not a tuple variant or struct

0 commit comments

Comments
 (0)