diff options
| author | David Wood <david@davidtw.co> | 2020-05-28 15:57:09 +0100 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2020-06-24 12:09:35 +0100 |
| commit | 14ea7a777f924995256a05da55133d265ed169be (patch) | |
| tree | 269733c6438fff740e0b53cc40daaf34d40c5510 /src/liballoc | |
| parent | 3c90ae8404b6b83bc3cba35840ddf7edd500cc86 (diff) | |
| download | rust-14ea7a777f924995256a05da55133d265ed169be.tar.gz rust-14ea7a777f924995256a05da55133d265ed169be.zip | |
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 <david@davidtw.co>
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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<Foo> { //! Box::new(Foo) //! } //! //! #[no_mangle] +//! #[allow(improper_ctypes_definitions)] //! pub extern "C" fn foo_delete(_: Option<Box<Foo>>) {} //! ``` //! |
