aboutsummaryrefslogtreecommitdiff
path: root/syntax/cfg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/cfg.rs')
-rw-r--r--syntax/cfg.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/syntax/cfg.rs b/syntax/cfg.rs
index ce6f3389..070813ee 100644
--- a/syntax/cfg.rs
+++ b/syntax/cfg.rs
@@ -4,16 +4,19 @@ use syn::parse::{Error, ParseStream, Result};
use syn::{parenthesized, token, Attribute, LitStr, Token};
#[derive(Clone)]
-pub enum CfgExpr {
+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>),
}
impl CfgExpr {
- pub fn merge(&mut self, expr: CfgExpr) {
+ pub(crate) fn merge(&mut self, expr: CfgExpr) {
if let CfgExpr::Unconditional = self {
*self = expr;
} else if let CfgExpr::All(list) = self {
@@ -25,7 +28,7 @@ impl CfgExpr {
}
}
-pub fn parse_attribute(attr: &Attribute) -> Result<CfgExpr> {
+pub(crate) fn parse_attribute(attr: &Attribute) -> Result<CfgExpr> {
attr.parse_args_with(|input: ParseStream| {
let cfg_expr = input.call(parse_single)?;
input.parse::<Option<Token![,]>>()?;