Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
disallow unsized enums
  • Loading branch information
TimNN committed Oct 24, 2016
1 parent ac468b6 commit f169523
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/librustc/traits/error_reporting.rs
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/wfcheck.rs
Expand Up @@ -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)
});

Expand Down

0 comments on commit f169523

Please sign in to comment.