Merge pull request #1303 from dtolnay/deadcode

Work around new dead_code warnings
This commit is contained in:
David Tolnay 2024-01-05 19:03:19 -08:00 committed by GitHub
commit 5bbe3e8606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 2 deletions

View File

@ -548,4 +548,4 @@ chars! {
}
#[repr(transparent)]
struct void(core::ffi::c_void);
struct void(#[allow(dead_code)] core::ffi::c_void);

View File

@ -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>),
}

View File

@ -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),

View File

@ -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 {