Replace item names containing an error code with something more meaningful
or inline such functions if useless.
This commit is contained in:
parent
dec1d16a9b
commit
2a1d748254
19 changed files with 55 additions and 50 deletions
|
@ -632,20 +632,19 @@ impl<'a> AstValidator<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn emit_e0568(&self, span: Span, ident: Span) {
|
||||
self.dcx().emit_err(errors::AutoTraitBounds { span, ident });
|
||||
}
|
||||
|
||||
fn deny_super_traits(&self, bounds: &GenericBounds, ident_span: Span) {
|
||||
if let [.., last] = &bounds[..] {
|
||||
let span = ident_span.shrink_to_hi().to(last.span());
|
||||
self.emit_e0568(span, ident_span);
|
||||
self.dcx().emit_err(errors::AutoTraitBounds { span, ident: ident_span });
|
||||
}
|
||||
}
|
||||
|
||||
fn deny_where_clause(&self, where_clause: &WhereClause, ident_span: Span) {
|
||||
if !where_clause.predicates.is_empty() {
|
||||
self.emit_e0568(where_clause.span, ident_span);
|
||||
// FIXME: The current diagnostic is misleading since it only talks about
|
||||
// super trait and lifetime bounds while we should just say “bounds”.
|
||||
self.dcx()
|
||||
.emit_err(errors::AutoTraitBounds { span: where_clause.span, ident: ident_span });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue