Remove Pin UniquePtr support
diff --git a/macro/src/expand.rs b/macro/src/expand.rs
index 908d8bd..4f703b1 100644
--- a/macro/src/expand.rs
+++ b/macro/src/expand.rs
@@ -9,7 +9,6 @@
};
use proc_macro2::{Ident, Span, TokenStream};
use quote::{format_ident, quote, quote_spanned, ToTokens};
-use std::collections::BTreeSet as Set;
use std::mem;
use syn::{parse_quote, Result, Token};
@@ -61,7 +60,6 @@
}
}
- let mut expanded_unique_ptr = Set::new();
for ty in types {
let explicit_impl = types.explicit_impls.get(ty);
if let Type::RustBox(ty) = ty {
@@ -80,7 +78,6 @@
if let Type::Ident(ident) = &ptr.inner {
if Atom::from(&ident.rust).is_none()
&& (explicit_impl.is_some() || !types.aliases.contains_key(&ident.rust))
- && expanded_unique_ptr.insert(&ident.rust)
{
expanded.extend(expand_unique_ptr(ident, types, explicit_impl));
}
@@ -310,10 +307,7 @@
quote!(#var.as_mut_ptr() as *const ::cxx::private::RustString)
}
Type::RustBox(_) => quote!(::std::boxed::Box::into_raw(#var)),
- Type::UniquePtr(ptr) => match ptr.pinned {
- false => quote!(::cxx::UniquePtr::into_raw(#var)),
- true => quote!(::cxx::UniquePtr::__pin_into_raw(#var)),
- },
+ Type::UniquePtr(_) => quote!(::cxx::UniquePtr::into_raw(#var)),
Type::RustVec(_) => quote!(#var.as_mut_ptr() as *const ::cxx::private::RustVec<_>),
Type::Ref(ty) => match &ty.inner {
Type::Ident(ident) if ident.rust == RustString => match ty.mutable {
@@ -407,10 +401,7 @@
quote!(#call.into_vec())
}
}
- Type::UniquePtr(ptr) => match ptr.pinned {
- false => quote!(::cxx::UniquePtr::from_raw(#call)),
- true => quote!(::cxx::UniquePtr::__pin_from_raw(#call)),
- },
+ Type::UniquePtr(_) => quote!(::cxx::UniquePtr::from_raw(#call)),
Type::Ref(ty) => match &ty.inner {
Type::Ident(ident) if ident.rust == RustString => match ty.mutable {
false => quote!(#call.as_string()),
@@ -589,10 +580,7 @@
quote!(::std::mem::take((*#ident).as_mut_vec()))
}
}
- Type::UniquePtr(ptr) => match ptr.pinned {
- false => quote!(::cxx::UniquePtr::from_raw(#ident)),
- true => quote!(::cxx::UniquePtr::__pin_from_raw(#ident)),
- },
+ Type::UniquePtr(_) => quote!(::cxx::UniquePtr::from_raw(#ident)),
Type::Ref(ty) => match &ty.inner {
Type::Ident(i) if i.rust == RustString => match ty.mutable {
false => quote!(#ident.as_string()),
@@ -636,10 +624,7 @@
Some(quote!(::cxx::private::RustVec::from))
}
}
- Type::UniquePtr(ptr) => match ptr.pinned {
- false => Some(quote!(::cxx::UniquePtr::into_raw)),
- true => Some(quote!(::cxx::UniquePtr::__pin_into_raw)),
- },
+ Type::UniquePtr(_) => Some(quote!(::cxx::UniquePtr::into_raw)),
Type::Ref(ty) => match &ty.inner {
Type::Ident(ident) if ident.rust == RustString => match ty.mutable {
false => Some(quote!(::cxx::private::RustString::from_ref)),