Skip to content

Commit 15150c0

Browse files
committed
clippy_lint: Test for BoxedLocal false-positive in C-FFI and fix C-FFI Abi comparison.
1 parent 738ed38 commit 15150c0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
6868
hir_id: HirId,
6969
) {
7070
if let Some(header) = fn_kind.header() {
71-
if header.abi == Abi::Cdecl {
71+
if header.abi == Abi::C {
7272
return;
7373
}
7474
}

tests/ui/escape_analysis.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,8 @@ mod issue_3739 {
174174
};
175175
}
176176
}
177+
178+
/// Issue #5542
179+
///
180+
/// This shouldn't warn for `boxed_local` as it is a function implemented in C.
181+
pub extern "C" fn do_now_warn_me(_c_pointer: Box<String>) -> () {}

0 commit comments

Comments
 (0)