diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/Cargo.toml b/Cargo.toml index 1da03661bb..995b2f1d9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,6 +77,9 @@ internal-tests = [ "tokio/rt-multi-thread", ] +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docs)'] } + [dev-dependencies] safer-ffi.path = "." safer-ffi.features = ["internal-tests"] @@ -110,7 +113,7 @@ scopeguard.default-features = false serde.version = "1.0.204" serde.optional = true -serde.default_features = false +serde.default-features = false stabby.version = "36.1.1" stabby.optional = true diff --git a/src/proc_macro/derives/c_type/struct_.rs b/src/proc_macro/derives/c_type/struct_.rs index 7005553431..59828315c8 100644 --- a/src/proc_macro/derives/c_type/struct_.rs +++ b/src/proc_macro/derives/c_type/struct_.rs @@ -2,6 +2,7 @@ use super::*; +#[allow(unexpected_cfgs)] pub(in crate) fn derive ( args: Args, diff --git a/src/proc_macro/derives/dyn_trait/args.rs b/src/proc_macro/derives/dyn_trait/args.rs index cfa910d42e..b9c860a0c7 100644 --- a/src/proc_macro/derives/dyn_trait/args.rs +++ b/src/proc_macro/derives/dyn_trait/args.rs @@ -28,6 +28,7 @@ define_kws! {$ pub struct Args { + #[allow(dead_code)] pub dyn_: sym![dyn], pub clone: Option, } diff --git a/src/proc_macro/derives/dyn_trait/coercions.rs b/src/proc_macro/derives/dyn_trait/coercions.rs index 997002273a..066fff6a6a 100644 --- a/src/proc_macro/derives/dyn_trait/coercions.rs +++ b/src/proc_macro/derives/dyn_trait/coercions.rs @@ -283,6 +283,7 @@ match_! {( struct Env<'r> { // quote-interpolable/friendly stuff from the caller. $( + #[allow(dead_code)] pub $field : &'r dyn ToTokens, )* diff --git a/src/proc_macro/ffi_export/const_.rs b/src/proc_macro/ffi_export/const_.rs index 589ecd1052..93ab25774d 100644 --- a/src/proc_macro/ffi_export/const_.rs +++ b/src/proc_macro/ffi_export/const_.rs @@ -42,6 +42,7 @@ impl Parse for Args { } +#[allow(unexpected_cfgs)] pub(in super) fn handle ( Args { untyped }: Args, diff --git a/src/proc_macro/ffi_export/fn_/args.rs b/src/proc_macro/ffi_export/fn_/args.rs index e4abe899f0..c45c79b5e4 100644 --- a/src/proc_macro/ffi_export/fn_/args.rs +++ b/src/proc_macro/ffi_export/fn_/args.rs @@ -21,7 +21,7 @@ pub(in crate) struct Executor { pub(in crate) kw: kw::executor, pub(in crate) _eq: Token![=], - #[cfg_attr(not(feature = "async_fn"), + #[cfg_attr(not(feature = "async-fn"), allow(dead_code), )] pub(in crate) block_on: Expr, diff --git a/src/proc_macro/ffi_export/static_.rs b/src/proc_macro/ffi_export/static_.rs index a764f21987..fe6c9514b6 100644 --- a/src/proc_macro/ffi_export/static_.rs +++ b/src/proc_macro/ffi_export/static_.rs @@ -6,6 +6,5 @@ fn handle ( _input: ItemStatic, ) -> Result { - #[cfg(not(TODO))] todo!("`#[ffi_export]`ing a `static`"); }