Merge multiple mutable borrows of immutable binding errors

Fix #53466.
This commit is contained in:
Esteban Küber 2022-12-29 22:46:17 -08:00
parent bb6e76df06
commit 5bfcfeee2a
14 changed files with 199 additions and 93 deletions

View file

@ -3237,7 +3237,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
})) = call_node
{
if Some(rcvr.span) == err.span.primary_span() {
err.replace_span_with(path.ident.span);
err.replace_span_with(path.ident.span, true);
}
}
if let Some(Node::Expr(hir::Expr {