Skip to content

Commit f169523

Browse files
committed
disallow unsized enums
1 parent ac468b6 commit f169523

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
856856
trait_name));
857857
}
858858
ObligationCauseCode::FieldSized => {
859-
err.note("only the last field of a struct or enum variant \
860-
may have a dynamically sized type");
859+
err.note("only the last field of a struct may have a dynamically sized type");
861860
}
862861
ObligationCauseCode::ConstSized => {
863862
err.note("constant expressions must have a statically known size");

src/librustc_typeck/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
150150
self.check_variances_for_type_defn(item, ast_generics);
151151
}
152152
hir::ItemEnum(ref enum_def, ref ast_generics) => {
153-
self.check_type_defn(item, false, |fcx| {
153+
self.check_type_defn(item, true, |fcx| {
154154
fcx.enum_variants(enum_def)
155155
});
156156

0 commit comments

Comments
 (0)