aboutsummaryrefslogtreecommitdiff
path: root/src/shared_ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared_ptr.rs')
-rw-r--r--src/shared_ptr.rs34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/shared_ptr.rs b/src/shared_ptr.rs
index 64c86619..58a281b8 100644
--- a/src/shared_ptr.rs
+++ b/src/shared_ptr.rs
@@ -191,8 +191,8 @@ pub unsafe trait SharedPtrTarget {
where
Self: Sized,
{
- // Opoaque C types do not get this method because they can never exist
- // by value on the Rust side of the bridge.
+ // Opaque C types do not get this method because they can never exist by
+ // value on the Rust side of the bridge.
let _ = value;
let _ = new;
unreachable!()
@@ -213,46 +213,36 @@ macro_rules! impl_shared_ptr_target {
}
unsafe fn __null(new: *mut c_void) {
extern "C" {
- attr! {
- #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$null")]
- fn __null(new: *mut c_void);
- }
+ #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$null")]
+ fn __null(new: *mut c_void);
}
unsafe { __null(new) }
}
unsafe fn __new(value: Self, new: *mut c_void) {
extern "C" {
- attr! {
- #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$uninit")]
- fn __uninit(new: *mut c_void) -> *mut c_void;
- }
+ #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$uninit")]
+ fn __uninit(new: *mut c_void) -> *mut c_void;
}
unsafe { __uninit(new).cast::<$ty>().write(value) }
}
unsafe fn __clone(this: *const c_void, new: *mut c_void) {
extern "C" {
- attr! {
- #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$clone")]
- fn __clone(this: *const c_void, new: *mut c_void);
- }
+ #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$clone")]
+ fn __clone(this: *const c_void, new: *mut c_void);
}
unsafe { __clone(this, new) }
}
unsafe fn __get(this: *const c_void) -> *const Self {
extern "C" {
- attr! {
- #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$get")]
- fn __get(this: *const c_void) -> *const c_void;
- }
+ #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$get")]
+ fn __get(this: *const c_void) -> *const c_void;
}
unsafe { __get(this) }.cast()
}
unsafe fn __drop(this: *mut c_void) {
extern "C" {
- attr! {
- #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$drop")]
- fn __drop(this: *mut c_void);
- }
+ #[link_name = concat!("cxxbridge1$std$shared_ptr$", $segment, "$drop")]
+ fn __drop(this: *mut c_void);
}
unsafe { __drop(this) }
}