Add error for existential types
This commit is contained in:
parent
03122e1bac
commit
da46eeac88
@ -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");
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user