disallow unsized enums
This commit is contained in:
parent
ac468b67bf
commit
f1695238ca
@ -856,8 +856,7 @@ fn note_obligation_cause_code<T>(&self,
|
||||
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");
|
||||
|
@ -150,7 +150,7 @@ fn check_item_well_formed(&mut self, item: &hir::Item) {
|
||||
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)
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user