Rollup merge of #113419 - spastorino:new-rpitit-28, r=compiler-errors
Avoid calling item_name for RPITIT Fixes #113405 r? `@compiler-errors`
This commit is contained in:
commit
901c863644
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