Skip to content

Commit 83eaede

Browse files
Make RawPtr take Ty and Mutbl separately
1 parent 678e624 commit 83eaede

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/intrinsic/simd.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -796,16 +796,16 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
796796

797797
// This counts how many pointers
798798
fn ptr_count(t: Ty<'_>) -> usize {
799-
match t.kind() {
800-
ty::RawPtr(p) => 1 + ptr_count(p.ty),
799+
match *t.kind() {
800+
ty::RawPtr(p_ty, _) => 1 + ptr_count(p_ty),
801801
_ => 0,
802802
}
803803
}
804804

805805
// Non-ptr type
806806
fn non_ptr(t: Ty<'_>) -> Ty<'_> {
807-
match t.kind() {
808-
ty::RawPtr(p) => non_ptr(p.ty),
807+
match *t.kind() {
808+
ty::RawPtr(p_ty, _) => non_ptr(p_ty),
809809
_ => t,
810810
}
811811
}
@@ -814,8 +814,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
814814
// to the element type of the first argument
815815
let (_, element_ty0) = arg_tys[0].simd_size_and_type(bx.tcx());
816816
let (_, element_ty1) = arg_tys[1].simd_size_and_type(bx.tcx());
817-
let (pointer_count, underlying_ty) = match element_ty1.kind() {
818-
ty::RawPtr(p) if p.ty == in_elem => (ptr_count(element_ty1), non_ptr(element_ty1)),
817+
let (pointer_count, underlying_ty) = match *element_ty1.kind() {
818+
ty::RawPtr(p_ty, _) if p_ty == in_elem => (ptr_count(element_ty1), non_ptr(element_ty1)),
819819
_ => {
820820
require!(
821821
false,
@@ -910,16 +910,16 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
910910

911911
// This counts how many pointers
912912
fn ptr_count(t: Ty<'_>) -> usize {
913-
match t.kind() {
914-
ty::RawPtr(p) => 1 + ptr_count(p.ty),
913+
match *t.kind() {
914+
ty::RawPtr(p_ty, _) => 1 + ptr_count(p_ty),
915915
_ => 0,
916916
}
917917
}
918918

919919
// Non-ptr type
920920
fn non_ptr(t: Ty<'_>) -> Ty<'_> {
921-
match t.kind() {
922-
ty::RawPtr(p) => non_ptr(p.ty),
921+
match *t.kind() {
922+
ty::RawPtr(p_ty, _) => non_ptr(p_ty),
923923
_ => t,
924924
}
925925
}
@@ -929,8 +929,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
929929
let (_, element_ty0) = arg_tys[0].simd_size_and_type(bx.tcx());
930930
let (_, element_ty1) = arg_tys[1].simd_size_and_type(bx.tcx());
931931
let (_, element_ty2) = arg_tys[2].simd_size_and_type(bx.tcx());
932-
let (pointer_count, underlying_ty) = match element_ty1.kind() {
933-
ty::RawPtr(p) if p.ty == in_elem && p.mutbl == hir::Mutability::Mut => {
932+
let (pointer_count, underlying_ty) = match *element_ty1.kind() {
933+
ty::RawPtr(p_ty, mutbl) if p_ty == in_elem && mutbl == hir::Mutability::Mut => {
934934
(ptr_count(element_ty1), non_ptr(element_ty1))
935935
}
936936
_ => {

0 commit comments

Comments
 (0)