about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Neumann <mail@timnn.me>2016-10-12 12:40:48 +0200
committerTim Neumann <mail@timnn.me>2016-10-24 20:07:14 +0200
commitf1695238cae0c7c6598fa736820837d35a2143cf (patch)
tree515bc595b40b12644cd07635a6d9a20b43d93e28
parentac468b67bffc6c386dd04b7955eec013ef99dc39 (diff)
downloadrust-f1695238cae0c7c6598fa736820837d35a2143cf.tar.gz
rust-f1695238cae0c7c6598fa736820837d35a2143cf.zip
disallow unsized enums
-rw-r--r--src/librustc/traits/error_reporting.rs3
-rw-r--r--src/librustc_typeck/check/wfcheck.rs2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs
index 52ddd8ab5da..4aff84d8199 100644
--- a/src/librustc/traits/error_reporting.rs
+++ b/src/librustc/traits/error_reporting.rs
@@ -856,8 +856,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
                              trait_name));
             }
             ObligationCauseCode::FieldSized => {
-                err.note("only the last field of a struct or enum variant \
-                          may have a dynamically sized type");
+                err.note("only the last field of a struct may have a dynamically sized type");
             }
             ObligationCauseCode::ConstSized => {
                 err.note("constant expressions must have a statically known size");
diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs
index bc5cb68995b..e3634cfe5f5 100644
--- a/src/librustc_typeck/check/wfcheck.rs
+++ b/src/librustc_typeck/check/wfcheck.rs
@@ -150,7 +150,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
                 self.check_variances_for_type_defn(item, ast_generics);
             }
             hir::ItemEnum(ref enum_def, ref ast_generics) => {
-                self.check_type_defn(item, false, |fcx| {
+                self.check_type_defn(item, true, |fcx| {
                     fcx.enum_variants(enum_def)
                 });