clippy_lint: Test for BoxedLocal false-positive in C-FFI and fix C-FFI Abi comparison.

This commit is contained in:
João Paulo Taylor Ienczak Zanette 2020-10-07 22:49:50 -03:00
parent 738ed38306
commit 15150c07ea
2 changed files with 6 additions and 1 deletions

View File

@ -68,7 +68,7 @@ fn check_fn(
hir_id: HirId,
) {
if let Some(header) = fn_kind.header() {
if header.abi == Abi::Cdecl {
if header.abi == Abi::C {
return;
}
}

View File

@ -174,3 +174,8 @@ fn closure_borrow(x: Box<A>) {
};
}
}
/// Issue #5542
///
/// This shouldn't warn for `boxed_local` as it is a function implemented in C.
pub extern "C" fn do_now_warn_me(_c_pointer: Box<String>) -> () {}