From 283772c4c9e48b85aec98f22d6107fad937a5cad Mon Sep 17 00:00:00 2001 From: ReversedCausality Date: Fri, 20 Oct 2023 20:37:40 +0100 Subject: [PATCH] Added repr transparent. --- luisa_compute_derive_impl/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/luisa_compute_derive_impl/src/lib.rs b/luisa_compute_derive_impl/src/lib.rs index 36f5720..ed9add1 100644 --- a/luisa_compute_derive_impl/src/lib.rs +++ b/luisa_compute_derive_impl/src/lib.rs @@ -55,13 +55,10 @@ impl Compiler { let path = &list.path; if path.is_ident("repr") { for tok in list.tokens.clone().into_iter() { - match tok { - TokenTree::Ident(ident) => { - if ident == "C" { - has_repr_c = true; - } + if let TokenTree::Ident(ident) = tok { + if ident == "C" || ident == "transparent" { + has_repr_c = true; } - _ => {} } } } else if path.is_ident("value_new") {