Skip to content

Commit da46eea

Browse files
committed
Add error for existential types
1 parent 03122e1 commit da46eea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc_passes/ast_validation.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,12 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
679679
"unions cannot have zero fields");
680680
}
681681
}
682+
ItemKind::Existential(ref bounds, _) => {
683+
if !bounds.iter()
684+
.any(|b| if let GenericBound::Trait(..) = *b { true } else { false }) {
685+
self.err_handler().span_err(item.span, "at least one trait must be specified");
686+
}
687+
}
682688
_ => {}
683689
}
684690

0 commit comments

Comments
 (0)