Add error for existential types

This commit is contained in:
Yuki OKUSHI 2019-04-30 20:43:03 +09:00
parent 03122e1bac
commit da46eeac88

View File

@ -679,6 +679,12 @@ fn visit_item(&mut self, item: &'a Item) {
"unions cannot have zero fields");
}
}
ItemKind::Existential(ref bounds, _) => {
if !bounds.iter()
.any(|b| if let GenericBound::Trait(..) = *b { true } else { false }) {
self.err_handler().span_err(item.span, "at least one trait must be specified");
}
}
_ => {}
}