Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejig typeconversionpolicy #1129

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove old from_box stuff
adetaylor committed Jun 24, 2022
commit dfb60cc11c43cfb1b90c2d5f619e719cdb8223b9
12 changes: 0 additions & 12 deletions engine/src/conversion/codegen_rs/mod.rs
Original file line number Diff line number Diff line change
@@ -150,14 +150,6 @@ fn get_cppref_items() -> Vec<Item> {
}
}
}),
Item::Impl(parse_quote! {
impl<'a, T: ::cxx::private::UniquePtrTarget> CppRef<'a, T> {
/// Create a `CppRef` to an item within a pinned box.
pub fn from_box(boxed_item: &'a ::std::pin::Pin<::std::boxed::Box<T>>) -> Self {
Self(unsafe { ::std::pin::Pin::into_inner_unchecked(boxed_item.as_ref()) as *const T }, ::std::marker::PhantomData)
}
}
}),
Item::Struct(parse_quote! {
#[repr(transparent)]
pub struct CppMutRef<'a, T>(pub *mut T, pub ::std::marker::PhantomData<&'a T>);
@@ -178,10 +170,6 @@ fn get_cppref_items() -> Vec<Item> {
}),
Item::Impl(parse_quote! {
impl<'a, T: ::cxx::private::UniquePtrTarget> CppMutRef<'a, T> {
/// Create a `CppMutRef` to an item within a pinned box.
pub fn from_box(boxed_item: &'a mut ::std::pin::Pin<::std::boxed::Box<T>>) -> Self {
Self(unsafe { ::std::pin::Pin::into_inner_unchecked(boxed_item.as_mut()) as *mut T }, ::std::marker::PhantomData)
}
/// Create a const C++ reference from this mutable C++ reference.
pub fn as_cpp_ref(&self) -> CppRef<'a, T> {
use autocxx::CppRef;