diff --git a/luisa_compute/src/lang/types.rs b/luisa_compute/src/lang/types.rs index 05007dc..a72af68 100644 --- a/luisa_compute/src/lang/types.rs +++ b/luisa_compute/src/lang/types.rs @@ -76,7 +76,7 @@ pub trait VarProxy: Copy + 'static + Deref> { fn from_var(expr: Var) -> Self; } -pub unsafe trait AtomicRefProxy: Copy + 'static { +pub trait AtomicRefProxy: Copy + 'static { type Value: Value; fn as_atomic_ref_from_proxy(&self) -> &AtomicRef; @@ -405,7 +405,7 @@ macro_rules! impl_simple_atomic_ref_proxy { #[derive(Clone, Copy)] #[repr(transparent)] pub struct $name $(< $($bounds)* >)? ($crate::lang::types::AtomicRef<$t>) $(where $($where_bounds)+)?; - unsafe impl $(< $($bounds)* >)? $crate::lang::types::AtomicRefProxy for $name $(< $($qualifiers)* >)? $(where $($where_bounds)+)? { + impl $(< $($bounds)* >)? $crate::lang::types::AtomicRefProxy for $name $(< $($qualifiers)* >)? $(where $($where_bounds)+)? { type Value = $t; fn from_atomic_ref(var: $crate::lang::types::AtomicRef<$t>) -> Self { Self(var) diff --git a/luisa_compute/src/lang/types/vector.rs b/luisa_compute/src/lang/types/vector.rs index 18e4755..ddbf8e0 100644 --- a/luisa_compute/src/lang/types/vector.rs +++ b/luisa_compute/src/lang/types/vector.rs @@ -221,7 +221,7 @@ macro_rules! vector_proxies { _deref_proxy(self) } } - unsafe impl>> AtomicRefProxy for $AtomicName { + impl>> AtomicRefProxy for $AtomicName { type Value = Vector; #[allow(unused_assignments)] fn from_atomic_ref(e:AtomicRef) -> Self { diff --git a/luisa_compute_derive_impl/src/lib.rs b/luisa_compute_derive_impl/src/lib.rs index b97dd35..36f5720 100644 --- a/luisa_compute_derive_impl/src/lib.rs +++ b/luisa_compute_derive_impl/src/lib.rs @@ -474,7 +474,7 @@ impl Compiler { } } #[allow(unused_parens)] - unsafe impl #impl_generics #lang_path::types::AtomicRefProxy for #atomic_ref_proxy_name #ty_generics #where_clause { + impl #impl_generics #lang_path::types::AtomicRefProxy for #atomic_ref_proxy_name #ty_generics #where_clause { type Value = #name #ty_generics; fn from_atomic_ref(var: #lang_path::types::AtomicRef<#name #ty_generics>) -> Self { use #lang_path::ToNode;