Skip to content

Commit d44f2b0

Browse files
compiler-errorsGuillaumeGomez
authored andcommitted
Make RawPtr take Ty and Mutbl separately
1 parent 2e84bb9 commit d44f2b0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/intrinsic/simd.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -794,15 +794,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
794794
// This counts how many pointers
795795
fn ptr_count(t: Ty<'_>) -> usize {
796796
match *t.kind() {
797-
ty::RawPtr(p) => 1 + ptr_count(p.ty),
797+
ty::RawPtr(p_ty, _) => 1 + ptr_count(p_ty),
798798
_ => 0,
799799
}
800800
}
801801

802802
// Non-ptr type
803803
fn non_ptr(t: Ty<'_>) -> Ty<'_> {
804804
match *t.kind() {
805-
ty::RawPtr(p) => non_ptr(p.ty),
805+
ty::RawPtr(p_ty, _) => non_ptr(p_ty),
806806
_ => t,
807807
}
808808
}
@@ -812,7 +812,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
812812
let (_, element_ty0) = arg_tys[0].simd_size_and_type(bx.tcx());
813813
let (_, element_ty1) = arg_tys[1].simd_size_and_type(bx.tcx());
814814
let (pointer_count, underlying_ty) = match *element_ty1.kind() {
815-
ty::RawPtr(p) if p.ty == in_elem => (ptr_count(element_ty1), non_ptr(element_ty1)),
815+
ty::RawPtr(p_ty, _) if p_ty == in_elem => (ptr_count(element_ty1), non_ptr(element_ty1)),
816816
_ => {
817817
require!(
818818
false,
@@ -908,15 +908,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
908908
// This counts how many pointers
909909
fn ptr_count(t: Ty<'_>) -> usize {
910910
match *t.kind() {
911-
ty::RawPtr(p) => 1 + ptr_count(p.ty),
911+
ty::RawPtr(p_ty, _) => 1 + ptr_count(p_ty),
912912
_ => 0,
913913
}
914914
}
915915

916916
// Non-ptr type
917917
fn non_ptr(t: Ty<'_>) -> Ty<'_> {
918918
match *t.kind() {
919-
ty::RawPtr(p) => non_ptr(p.ty),
919+
ty::RawPtr(p_ty, _) => non_ptr(p_ty),
920920
_ => t,
921921
}
922922
}
@@ -927,7 +927,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
927927
let (_, element_ty1) = arg_tys[1].simd_size_and_type(bx.tcx());
928928
let (_, element_ty2) = arg_tys[2].simd_size_and_type(bx.tcx());
929929
let (pointer_count, underlying_ty) = match *element_ty1.kind() {
930-
ty::RawPtr(p) if p.ty == in_elem && p.mutbl == hir::Mutability::Mut => {
930+
ty::RawPtr(p_ty, mutbl) if p_ty == in_elem && mutbl == hir::Mutability::Mut => {
931931
(ptr_count(element_ty1), non_ptr(element_ty1))
932932
}
933933
_ => {

0 commit comments

Comments
 (0)