Skip to content

Commit 6a74a0e

Browse files
committed
compiler: Lower fn call arg spans down to MIR
To enable improved accuracy of diagnostics in upcoming commits.
1 parent 5a45dbe commit 6a74a0e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clippy_lints/src/redundant_clone.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ fn is_call_with_ref_arg<'tcx>(
257257
..
258258
} = kind
259259
&& args.len() == 1
260-
&& let mir::Operand::Move(mir::Place { local, .. }) = &args[0]
260+
&& let mir::Operand::Move(mir::Place { local, .. }) = &args[0].node
261261
&& let ty::FnDef(def_id, _) = *func.ty(mir, cx.tcx).kind()
262-
&& let (inner_ty, 1) = walk_ptrs_ty_depth(args[0].ty(mir, cx.tcx))
262+
&& let (inner_ty, 1) = walk_ptrs_ty_depth(args[0].node.ty(mir, cx.tcx))
263263
&& !is_copy(cx, inner_ty)
264264
{
265265
Some((def_id, *local, inner_ty, destination.as_local()?))

clippy_utils/src/mir/possible_borrower.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl<'a, 'b, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'b,
104104
let mut mutable_borrowers = vec![];
105105

106106
for op in args {
107-
match op {
107+
match &op.node {
108108
mir::Operand::Copy(p) | mir::Operand::Move(p) => {
109109
if let ty::Ref(_, _, Mutability::Mut) = self.body.local_decls[p.local].ty.kind() {
110110
mutable_borrowers.push(p.local);

clippy_utils/src/qualify_min_const_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ fn check_terminator<'tcx>(
345345
check_operand(tcx, func, span, body)?;
346346

347347
for arg in args {
348-
check_operand(tcx, arg, span, body)?;
348+
check_operand(tcx, &arg.node, span, body)?;
349349
}
350350
Ok(())
351351
} else {

0 commit comments

Comments
 (0)