Point at method call when it is the source of the bound error
This commit is contained in:
parent
ce486d538b
commit
2838b8e515
29 changed files with 93 additions and 161 deletions
|
@ -3108,6 +3108,16 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
point_at_chain(expr);
|
||||
}
|
||||
}
|
||||
let call_node = hir.find(call_hir_id);
|
||||
if let Some(Node::Expr(hir::Expr {
|
||||
kind: hir::ExprKind::MethodCall(path, rcvr, ..),
|
||||
..
|
||||
})) = call_node
|
||||
{
|
||||
if Some(rcvr.span) == err.span.primary_span() {
|
||||
err.replace_span_with(path.ident.span);
|
||||
}
|
||||
}
|
||||
if let Some(Node::Expr(hir::Expr {
|
||||
kind:
|
||||
hir::ExprKind::Call(hir::Expr { span, .. }, _)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue