1
Fork 0

Replace item names containing an error code with something more meaningful

or inline such functions if useless.
This commit is contained in:
León Orell Valerian Liehr 2024-04-25 03:11:19 +02:00
parent dec1d16a9b
commit 2a1d748254
No known key found for this signature in database
GPG key ID: D17A07215F68E713
19 changed files with 55 additions and 50 deletions

View file

@ -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 });
}
}