about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_typeck/lib.rs2
-rw-r--r--src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.rs8
-rw-r--r--src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.stderr20
-rw-r--r--src/test/ui/type-alias-enum-variants.rs1
4 files changed, 20 insertions, 11 deletions
diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs
index 4950ea31927..8c0913a56b5 100644
--- a/src/librustc_typeck/lib.rs
+++ b/src/librustc_typeck/lib.rs
@@ -141,7 +141,7 @@ fn allow_type_alias_enum_variants<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
             if let Def::TyAlias(_) = path.def {
                 let mut err = tcx.sess.struct_span_err(
                     span,
-                    "type alias enum variants are not yet allowed"
+                    "enum variants on type aliases are experimental"
                 );
                 if nightly_options::is_nightly_build() {
                     help!(&mut err,
diff --git a/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.rs b/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.rs
index 39472af43fd..2dcd0dcd243 100644
--- a/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.rs
+++ b/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.rs
@@ -17,9 +17,17 @@ type Alias = Foo;
 
 fn main() {
     let t = Alias::Bar(0);
+    //~^ ERROR enum variants on type aliases are experimental
+    //~^^ ERROR no variant named `Bar` found for type `Foo` in the current scope
     let t = Alias::Baz { i: 0 };
+    //~^ ERROR enum variants on type aliases are experimental
+    //~^^ ERROR ambiguous associated type
     match t {
         Alias::Bar(_i) => {}
+        //~^ ERROR enum variants on type aliases are experimental
+        //~^^ ERROR no variant named `Bar` found for type `Foo` in the current scope
         Alias::Baz { i: _i } => {}
+        //~^ ERROR enum variants on type aliases are experimental
+        //~^^ ERROR ambiguous associated type
     }
 }
diff --git a/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.stderr b/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.stderr
index 7dce09e483f..7a49770d97a 100644
--- a/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.stderr
+++ b/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.stderr
@@ -1,4 +1,4 @@
-error: type alias enum variants are not yet allowed
+error: enum variants on type aliases are experimental
   --> $DIR/feature-gate-type_alias_enum_variants.rs:19:13
    |
 LL |     let t = Alias::Bar(0);
@@ -19,8 +19,8 @@ LL |     let t = Alias::Bar(0);
    |
    = help: did you mean `Bar`?
 
-error: type alias enum variants are not yet allowed
-  --> $DIR/feature-gate-type_alias_enum_variants.rs:20:13
+error: enum variants on type aliases are experimental
+  --> $DIR/feature-gate-type_alias_enum_variants.rs:22:13
    |
 LL |     let t = Alias::Baz { i: 0 };
    |             ^^^^^^^^^^
@@ -28,13 +28,13 @@ LL |     let t = Alias::Baz { i: 0 };
    = help: add `#![feature(type_alias_enum_variants)]` to the crate attributes to enable
 
 error[E0223]: ambiguous associated type
-  --> $DIR/feature-gate-type_alias_enum_variants.rs:20:13
+  --> $DIR/feature-gate-type_alias_enum_variants.rs:22:13
    |
 LL |     let t = Alias::Baz { i: 0 };
    |             ^^^^^^^^^^ help: use fully-qualified syntax: `<Foo as Trait>::Baz`
 
-error: type alias enum variants are not yet allowed
-  --> $DIR/feature-gate-type_alias_enum_variants.rs:22:9
+error: enum variants on type aliases are experimental
+  --> $DIR/feature-gate-type_alias_enum_variants.rs:26:9
    |
 LL |         Alias::Bar(_i) => {}
    |         ^^^^^^^^^^^^^^
@@ -42,7 +42,7 @@ LL |         Alias::Bar(_i) => {}
    = help: add `#![feature(type_alias_enum_variants)]` to the crate attributes to enable
 
 error[E0599]: no variant named `Bar` found for type `Foo` in the current scope
-  --> $DIR/feature-gate-type_alias_enum_variants.rs:22:16
+  --> $DIR/feature-gate-type_alias_enum_variants.rs:26:16
    |
 LL | enum Foo {
    | -------- variant `Bar` not found here
@@ -52,8 +52,8 @@ LL |         Alias::Bar(_i) => {}
    |
    = help: did you mean `Bar`?
 
-error: type alias enum variants are not yet allowed
-  --> $DIR/feature-gate-type_alias_enum_variants.rs:23:9
+error: enum variants on type aliases are experimental
+  --> $DIR/feature-gate-type_alias_enum_variants.rs:29:9
    |
 LL |         Alias::Baz { i: _i } => {}
    |         ^^^^^^^^^^
@@ -61,7 +61,7 @@ LL |         Alias::Baz { i: _i } => {}
    = help: add `#![feature(type_alias_enum_variants)]` to the crate attributes to enable
 
 error[E0223]: ambiguous associated type
-  --> $DIR/feature-gate-type_alias_enum_variants.rs:23:9
+  --> $DIR/feature-gate-type_alias_enum_variants.rs:29:9
    |
 LL |         Alias::Baz { i: _i } => {}
    |         ^^^^^^^^^^ help: use fully-qualified syntax: `<Foo as Trait>::Baz`
diff --git a/src/test/ui/type-alias-enum-variants.rs b/src/test/ui/type-alias-enum-variants.rs
index 8e5aaae0a93..73395e6a979 100644
--- a/src/test/ui/type-alias-enum-variants.rs
+++ b/src/test/ui/type-alias-enum-variants.rs
@@ -7,4 +7,5 @@ fn main() {
     let _ = Option::None::<u8>; // OK (Lint in future!)
     let _ = Alias::<u8>::None; // OK
     let _ = Alias::None::<u8>; // Error
+    //~^ type parameters are not allowed on this type
 }