Avoid calling item_name for RPITIT
This commit is contained in:
parent
c4c84df3b3
commit
c0c155137b
4 changed files with 102 additions and 3 deletions
|
@ -25,9 +25,11 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
"impl has stricter requirements than trait"
|
||||
);
|
||||
|
||||
if let Some(span) = self.tcx.hir().span_if_local(trait_item_def_id) {
|
||||
let item_name = self.tcx.item_name(impl_item_def_id.to_def_id());
|
||||
err.span_label(span, format!("definition of `{}` from trait", item_name));
|
||||
if !self.tcx.is_impl_trait_in_trait(trait_item_def_id) {
|
||||
if let Some(span) = self.tcx.hir().span_if_local(trait_item_def_id) {
|
||||
let item_name = self.tcx.item_name(impl_item_def_id.to_def_id());
|
||||
err.span_label(span, format!("definition of `{}` from trait", item_name));
|
||||
}
|
||||
}
|
||||
|
||||
err.span_label(error_span, format!("impl has extra requirement {}", requirement));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue