Skip to content

Commit

Permalink
Merge pull request #1303 from dtolnay/deadcode
Browse files Browse the repository at this point in the history
Work around new dead_code warnings
  • Loading branch information
dtolnay authored Jan 6, 2024
2 parents 2e0af3b + 92f405d commit 5bbe3e8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,4 +548,4 @@ chars! {
}

#[repr(transparent)]
struct void(core::ffi::c_void);
struct void(#[allow(dead_code)] core::ffi::c_void);
3 changes: 3 additions & 0 deletions syntax/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ use syn::{parenthesized, token, Attribute, LitStr, Token};
#[derive(Clone)]
pub(crate) enum CfgExpr {
Unconditional,
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
Eq(Ident, Option<LitStr>),
All(Vec<CfgExpr>),
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
Any(Vec<CfgExpr>),
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
Not(Box<CfgExpr>),
}

Expand Down
1 change: 1 addition & 0 deletions syntax/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub(crate) use self::parse::parse_items;
pub(crate) use self::types::Types;

pub(crate) enum Api {
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
Include(Include),
Struct(Struct),
Enum(Enum),
Expand Down
2 changes: 1 addition & 1 deletion tests/ffi/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ impl R {
}
}

pub struct Reference<'a>(&'a String);
pub struct Reference<'a>(pub &'a String);

impl ffi::Shared {
fn r_method_on_shared(&self) -> String {
Expand Down

0 comments on commit 5bbe3e8

Please sign in to comment.