Support raw pointers in cxx::bridge.
This allows raw pointers to types to be passed into and out of
cxx::bridge extern "C++" APIs. As normal with raw pointers in Rust,
there are no safety or lifetime guarantees.
Passing a raw pointer into such an API requires that the
function be marked "unsafe".
diff --git a/syntax/mod.rs b/syntax/mod.rs
index 30faccc..87e3454 100644
--- a/syntax/mod.rs
+++ b/syntax/mod.rs
@@ -204,6 +204,7 @@
SharedPtr(Box<Ty1>),
WeakPtr(Box<Ty1>),
Ref(Box<Ref>),
+ Ptr(Box<Ptr>),
Str(Box<Ref>),
CxxVector(Box<Ty1>),
Fn(Box<Signature>),
@@ -229,6 +230,14 @@
pub mutability: Option<Token![mut]>,
}
+pub struct Ptr {
+ pub star: Token![*],
+ pub mutable: bool,
+ pub inner: Type,
+ pub mutability: Option<Token![mut]>,
+ pub constness: Option<Token![const]>,
+}
+
pub struct SliceRef {
pub ampersand: Token![&],
pub lifetime: Option<Lifetime>,