- ty::Slice(ref element_type)
- | ty::Ref(
- _,
- ty::TyS {
- kind: ty::Slice(ref element_type),
- ..
- },
- _,
- ) => is_recursively_primitive_type(element_type),
+ ty::Slice(element_type) => is_recursively_primitive_type(element_type),
+ ty::Ref(_, inner_ty, _) if matches!(inner_ty.kind(), &ty::Slice(_)) => {
+ if let ty::Slice(element_type) = inner_ty.kind() {
+ is_recursively_primitive_type(element_type)
+ } else {
+ unreachable!()
+ }
+ }