Simplify error reporting.
This commit is contained in:
parent
8b2409cd7d
commit
554aceba49
3 changed files with 42 additions and 38 deletions
|
@ -602,6 +602,25 @@ impl<'a> Resolver<'a> {
|
|||
|
||||
err
|
||||
}
|
||||
ResolutionError::TraitImplMismatch {
|
||||
name,
|
||||
kind,
|
||||
code,
|
||||
trait_item_span,
|
||||
trait_path,
|
||||
} => {
|
||||
let mut err = self.session.struct_span_err_with_code(
|
||||
span,
|
||||
&format!(
|
||||
"item `{}` is an associated {}, which doesn't match its trait `{}`",
|
||||
name, kind, trait_path,
|
||||
),
|
||||
code,
|
||||
);
|
||||
err.span_label(span, "does not match trait");
|
||||
err.span_label(trait_item_span, "item in trait");
|
||||
err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue