mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
ptr lint: check_mut_from_ref is checked independently of the function's ABI
This commit is contained in:
parent
30d06a810c
commit
7b8598d6c0
1 changed files with 4 additions and 2 deletions
|
@ -163,12 +163,13 @@ impl<'tcx> LateLintPass<'tcx> for Ptr {
|
|||
return;
|
||||
}
|
||||
|
||||
check_mut_from_ref(cx, sig, None);
|
||||
|
||||
if !matches!(sig.header.abi, Abi::Rust) {
|
||||
// Ignore `extern` functions with non-Rust calling conventions
|
||||
return;
|
||||
}
|
||||
|
||||
check_mut_from_ref(cx, sig, None);
|
||||
for arg in check_fn_args(
|
||||
cx,
|
||||
cx.tcx.fn_sig(item.owner_id).subst_identity().skip_binder().inputs(),
|
||||
|
@ -223,12 +224,13 @@ impl<'tcx> LateLintPass<'tcx> for Ptr {
|
|||
_ => return,
|
||||
};
|
||||
|
||||
check_mut_from_ref(cx, sig, Some(body));
|
||||
|
||||
if !matches!(sig.header.abi, Abi::Rust) {
|
||||
// Ignore `extern` functions with non-Rust calling conventions
|
||||
return;
|
||||
}
|
||||
|
||||
check_mut_from_ref(cx, sig, Some(body));
|
||||
let decl = sig.decl;
|
||||
let sig = cx.tcx.fn_sig(item_id).subst_identity().skip_binder();
|
||||
let lint_args: Vec<_> = check_fn_args(cx, sig.inputs(), decl.inputs, &decl.output, body.params)
|
||||
|
|
Loading…
Reference in a new issue