aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2024-01-05 19:03:19 -0800
committerGitHub <noreply@github.com>2024-01-05 19:03:19 -0800
commit5bbe3e8606cce9cfbb485cff3256f52579a976cf (patch)
treec7b2bd7ddef4d35b655077ffc7c05450fec2dc1e
parent2e0af3bd060e3c50bed39a536a6fc868715f0544 (diff)
parent92f405d4c81c067cf7688d0549a9938b412ee803 (diff)
downloadcxx-5bbe3e8606cce9cfbb485cff3256f52579a976cf.tar.gz
Merge pull request #1303 from dtolnay/deadcode
Work around new dead_code warnings
-rw-r--r--src/lib.rs2
-rw-r--r--syntax/cfg.rs3
-rw-r--r--syntax/mod.rs1
-rw-r--r--tests/ffi/lib.rs2
4 files changed, 6 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d2c7cf39..34a88592 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -548,4 +548,4 @@ chars! {
}
#[repr(transparent)]
-struct void(core::ffi::c_void);
+struct void(#[allow(dead_code)] core::ffi::c_void);
diff --git a/syntax/cfg.rs b/syntax/cfg.rs
index 83511d73..070813ee 100644
--- a/syntax/cfg.rs
+++ b/syntax/cfg.rs
@@ -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>),
}
diff --git a/syntax/mod.rs b/syntax/mod.rs
index 5ff343b4..eacba554 100644
--- a/syntax/mod.rs
+++ b/syntax/mod.rs
@@ -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),
diff --git a/tests/ffi/lib.rs b/tests/ffi/lib.rs
index ef8d5b37..f3a8310f 100644
--- a/tests/ffi/lib.rs
+++ b/tests/ffi/lib.rs
@@ -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 {