Skip to content

Commit 5bbe3e8

Browse files
authored
Merge pull request #1303 from dtolnay/deadcode
Work around new dead_code warnings
2 parents 2e0af3b + 92f405d commit 5bbe3e8

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,4 +548,4 @@ chars! {
548548
}
549549

550550
#[repr(transparent)]
551-
struct void(core::ffi::c_void);
551+
struct void(#[allow(dead_code)] core::ffi::c_void);

syntax/cfg.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ use syn::{parenthesized, token, Attribute, LitStr, Token};
66
#[derive(Clone)]
77
pub(crate) enum CfgExpr {
88
Unconditional,
9+
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
910
Eq(Ident, Option<LitStr>),
1011
All(Vec<CfgExpr>),
12+
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
1113
Any(Vec<CfgExpr>),
14+
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
1215
Not(Box<CfgExpr>),
1316
}
1417

syntax/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pub(crate) use self::parse::parse_items;
4949
pub(crate) use self::types::Types;
5050

5151
pub(crate) enum Api {
52+
#[allow(dead_code)] // only used by cxx-build, not cxxbridge-macro
5253
Include(Include),
5354
Struct(Struct),
5455
Enum(Enum),

tests/ffi/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl R {
408408
}
409409
}
410410

411-
pub struct Reference<'a>(&'a String);
411+
pub struct Reference<'a>(pub &'a String);
412412

413413
impl ffi::Shared {
414414
fn r_method_on_shared(&self) -> String {

0 commit comments

Comments
 (0)