From 14ea7a777f924995256a05da55133d265ed169be Mon Sep 17 00:00:00 2001 From: David Wood Date: Thu, 28 May 2020 15:57:09 +0100 Subject: lints: add `improper_ctypes_definitions` This commit adds a new lint - `improper_ctypes_definitions` - which functions identically to `improper_ctypes`, but on `extern "C" fn` definitions (as opposed to `improper_ctypes`'s `extern "C" {}` declarations). Signed-off-by: David Wood --- src/liballoc/boxed.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/liballoc') diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index d10cbf1afab..f1b560b9b96 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -92,11 +92,13 @@ //! pub struct Foo; //! //! #[no_mangle] +//! #[allow(improper_ctypes_definitions)] //! pub extern "C" fn foo_new() -> Box { //! Box::new(Foo) //! } //! //! #[no_mangle] +//! #[allow(improper_ctypes_definitions)] //! pub extern "C" fn foo_delete(_: Option>) {} //! ``` //! -- cgit 1.4.1-3-g733a5