You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-cxxbridge-macro/fix-variants-from-headers-b...

29 lines
978 B

From cf5bbe629ee54649e5ccb195bfd10e3c3b03ae53 Mon Sep 17 00:00:00 2001
From: David Tolnay <dtolnay@gmail.com>
Date: Tue, 18 Jan 2022 17:21:08 -0800
Subject: [PATCH] Fix variants_from_header build
---
macro/src/load.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/macro/src/load.rs b/macro/src/load.rs
index d769ebf6..baf88413 100644
--- a/macro/src/load.rs
+++ b/macro/src/load.rs
@@ -1,5 +1,6 @@
use crate::clang::{Clang, Node};
use crate::syntax::attrs::OtherAttrs;
+use crate::syntax::cfg::CfgExpr;
use crate::syntax::namespace::Namespace;
use crate::syntax::report::Errors;
use crate::syntax::{Api, Discriminant, Doc, Enum, EnumRepr, ForeignName, Pair, Variant};
@@ -207,6 +208,7 @@ fn traverse<'a>(
}
};
enm.variants.push(Variant {
+ cfg: CfgExpr::Unconditional,
doc: Doc::new(),
attrs: OtherAttrs::none(),
name: Pair {