Skip to content

Commit

Permalink
Rust 1.81 lint fixes (#237)
Browse files Browse the repository at this point in the history
* rename .cargo/config -> .cargo/config.toml

* exclude docs feature flag

* use `default-features`

* fix typo in config

* drop feature gate that is never set

* allow deadcode un unused fields

* final set of fixes

---------

Co-authored-by: s4h <[email protected]>
  • Loading branch information
S4H and s4h authored Sep 3, 2024
1 parent 3e1f996 commit 2ad21c3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 3 deletions.
File renamed without changes.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/proc_macro/derives/c_type/struct_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use super::*;

#[allow(unexpected_cfgs)]
pub(in crate)
fn derive (
args: Args,
Expand Down
1 change: 1 addition & 0 deletions src/proc_macro/derives/dyn_trait/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ define_kws! {$

pub
struct Args {
#[allow(dead_code)]
pub dyn_: sym![dyn],
pub clone: Option<sym![Clone]>,
}
Expand Down
1 change: 1 addition & 0 deletions src/proc_macro/derives/dyn_trait/coercions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ match_! {(
struct Env<'r> {
// quote-interpolable/friendly stuff from the caller.
$(
#[allow(dead_code)]
pub
$field : &'r dyn ToTokens,
)*
Expand Down
1 change: 1 addition & 0 deletions src/proc_macro/ffi_export/const_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl Parse for Args {
}


#[allow(unexpected_cfgs)]
pub(in super)
fn handle (
Args { untyped }: Args,
Expand Down
2 changes: 1 addition & 1 deletion src/proc_macro/ffi_export/fn_/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/proc_macro/ffi_export/static_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ fn handle (
_input: ItemStatic,
) -> Result<TokenStream2>
{
#[cfg(not(TODO))]
todo!("`#[ffi_export]`ing a `static`");
}

0 comments on commit 2ad21c3

Please sign in to comment.