diff options
Diffstat (limited to 'library/stdarch/crates/stdarch-verify')
| -rw-r--r-- | library/stdarch/crates/stdarch-verify/src/lib.rs | 10 | ||||
| -rw-r--r-- | library/stdarch/crates/stdarch-verify/tests/arm.rs | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/library/stdarch/crates/stdarch-verify/src/lib.rs b/library/stdarch/crates/stdarch-verify/src/lib.rs index 3a5588bbfe1..1afb556aaba 100644 --- a/library/stdarch/crates/stdarch-verify/src/lib.rs +++ b/library/stdarch/crates/stdarch-verify/src/lib.rs @@ -97,11 +97,11 @@ fn functions(input: TokenStream, dirs: &[&str]) -> TokenStream { arguments.push(to_type(ty)); } for generic in f.sig.generics.params.iter() { - let ty = match *generic { - syn::GenericParam::Const(ref c) => &c.ty, + match *generic { + syn::GenericParam::Const(ref c) => const_arguments.push(to_type(&c.ty)), + syn::GenericParam::Type(ref _t) => (), _ => panic!("invalid generic argument on {name}"), }; - const_arguments.push(to_type(ty)); } let ret = match f.sig.output { syn::ReturnType::Default => quote! { None }, @@ -345,6 +345,10 @@ fn to_type(t: &syn::Type) -> proc_macro2::TokenStream { "v4f32" => quote! { &v4f32 }, "v2f64" => quote! { &v2f64 }, + // Generic types + "T" => quote! { &GENERICT }, + "U" => quote! { &GENERICU }, + s => panic!("unsupported type: \"{s}\""), }, syn::Type::Ptr(syn::TypePtr { diff --git a/library/stdarch/crates/stdarch-verify/tests/arm.rs b/library/stdarch/crates/stdarch-verify/tests/arm.rs index 1b18dbdaadd..ac1d5793d03 100644 --- a/library/stdarch/crates/stdarch-verify/tests/arm.rs +++ b/library/stdarch/crates/stdarch-verify/tests/arm.rs @@ -28,6 +28,8 @@ static U32: Type = Type::PrimUnsigned(32); static U64: Type = Type::PrimUnsigned(64); static U8: Type = Type::PrimUnsigned(8); static NEVER: Type = Type::Never; +static GENERICT: Type = Type::GenericParam("T"); +static GENERICU: Type = Type::GenericParam("U"); static F16X4: Type = Type::F(16, 4, 1); static F16X4X2: Type = Type::F(16, 4, 2); @@ -157,6 +159,7 @@ enum Type { PrimPoly(u8), MutPtr(&'static Type), ConstPtr(&'static Type), + GenericParam(&'static str), I(u8, u8, u8), U(u8, u8, u8), P(u8, u8, u8), @@ -456,6 +459,7 @@ fn verify_all_signatures() { && !rust.file.ends_with("v7.rs\"") && !rust.file.ends_with("v8.rs\"") && !rust.file.ends_with("tme.rs\"") + && !rust.file.ends_with("mte.rs\"") && !rust.file.ends_with("ex.rs\"") && !skip_intrinsic_verify.contains(&rust.name) { |
