@@ -426,7 +426,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
426
426
// a bind-by-ref means that the base_ty will be the type of the ident itself,
427
427
// but what we want here is the type of the underlying value being borrowed.
428
428
// So peel off one-level, turning the &T into T.
429
- match ty :: deref ( base_ty, false ) {
429
+ match base_ty. builtin_deref ( false ) {
430
430
Some ( t) => t. ty ,
431
431
None => { return Err ( ( ) ) ; }
432
432
}
@@ -928,13 +928,13 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
928
928
Some ( method_ty) => {
929
929
let ref_ty =
930
930
ty:: no_late_bound_regions (
931
- self . tcx ( ) , & ty :: ty_fn_ret ( method_ty) ) . unwrap ( ) . unwrap ( ) ;
931
+ self . tcx ( ) , & method_ty. fn_ret ( ) ) . unwrap ( ) . unwrap ( ) ;
932
932
self . cat_rvalue_node ( node. id ( ) , node. span ( ) , ref_ty)
933
933
}
934
934
None => base_cmt
935
935
} ;
936
936
let base_cmt_ty = base_cmt. ty ;
937
- match ty :: deref ( base_cmt_ty, true ) {
937
+ match base_cmt_ty. builtin_deref ( true ) {
938
938
Some ( mt) => {
939
939
let ret = self . cat_deref_common ( node, base_cmt, deref_cnt,
940
940
mt. ty ,
@@ -1023,11 +1023,11 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
1023
1023
base_cmt = self . cat_rvalue_node ( elt. id ( ) , elt. span ( ) , ref_ty) ;
1024
1024
1025
1025
// FIXME(#20649) -- why are we using the `self_ty` as the element type...?
1026
- let self_ty = ty :: ty_fn_sig ( method_ty) . input ( 0 ) ;
1026
+ let self_ty = method_ty. fn_sig ( ) . input ( 0 ) ;
1027
1027
ty:: no_late_bound_regions ( self . tcx ( ) , & self_ty) . unwrap ( )
1028
1028
}
1029
1029
None => {
1030
- match ty :: array_element_ty ( self . tcx ( ) , base_cmt. ty ) {
1030
+ match base_cmt. ty . builtin_index ( ) {
1031
1031
Some ( ty) => ty,
1032
1032
None => {
1033
1033
return Err ( ( ) ) ;
@@ -1081,7 +1081,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
1081
1081
span : elt. span ( ) ,
1082
1082
cat : cat_deref ( base_cmt. clone ( ) , 0 , ptr) ,
1083
1083
mutbl : m,
1084
- ty : match ty :: deref ( base_cmt. ty , false ) {
1084
+ ty : match base_cmt. ty . builtin_deref ( false ) {
1085
1085
Some ( mt) => mt. ty ,
1086
1086
None => self . tcx ( ) . sess . bug ( "Found non-derefable type" )
1087
1087
} ,
@@ -1375,7 +1375,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
1375
1375
// types are generated by method resolution and always have
1376
1376
// all late-bound regions fully instantiated, so we just want
1377
1377
// to skip past the binder.
1378
- ty:: no_late_bound_regions ( self . tcx ( ) , & ty :: ty_fn_ret ( method_ty) )
1378
+ ty:: no_late_bound_regions ( self . tcx ( ) , & method_ty. fn_ret ( ) )
1379
1379
. unwrap ( )
1380
1380
. unwrap ( ) // overloaded ops do not diverge, either
1381
1381
}
0 commit comments