@@ -426,7 +426,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
426426 // a bind-by-ref means that the base_ty will be the type of the ident itself,
427427 // but what we want here is the type of the underlying value being borrowed.
428428 // So peel off one-level, turning the &T into T.
429- match ty :: deref ( base_ty, false ) {
429+ match base_ty. builtin_deref ( false ) {
430430 Some ( t) => t. ty ,
431431 None => { return Err ( ( ) ) ; }
432432 }
@@ -928,13 +928,13 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
928928 Some ( method_ty) => {
929929 let ref_ty =
930930 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 ( ) ;
932932 self . cat_rvalue_node ( node. id ( ) , node. span ( ) , ref_ty)
933933 }
934934 None => base_cmt
935935 } ;
936936 let base_cmt_ty = base_cmt. ty ;
937- match ty :: deref ( base_cmt_ty, true ) {
937+ match base_cmt_ty. builtin_deref ( true ) {
938938 Some ( mt) => {
939939 let ret = self . cat_deref_common ( node, base_cmt, deref_cnt,
940940 mt. ty ,
@@ -1023,11 +1023,11 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
10231023 base_cmt = self . cat_rvalue_node ( elt. id ( ) , elt. span ( ) , ref_ty) ;
10241024
10251025 // 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 ) ;
10271027 ty:: no_late_bound_regions ( self . tcx ( ) , & self_ty) . unwrap ( )
10281028 }
10291029 None => {
1030- match ty :: array_element_ty ( self . tcx ( ) , base_cmt. ty ) {
1030+ match base_cmt. ty . builtin_index ( ) {
10311031 Some ( ty) => ty,
10321032 None => {
10331033 return Err ( ( ) ) ;
@@ -1081,7 +1081,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
10811081 span : elt. span ( ) ,
10821082 cat : cat_deref ( base_cmt. clone ( ) , 0 , ptr) ,
10831083 mutbl : m,
1084- ty : match ty :: deref ( base_cmt. ty , false ) {
1084+ ty : match base_cmt. ty . builtin_deref ( false ) {
10851085 Some ( mt) => mt. ty ,
10861086 None => self . tcx ( ) . sess . bug ( "Found non-derefable type" )
10871087 } ,
@@ -1375,7 +1375,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
13751375 // types are generated by method resolution and always have
13761376 // all late-bound regions fully instantiated, so we just want
13771377 // 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 ( ) )
13791379 . unwrap ( )
13801380 . unwrap ( ) // overloaded ops do not diverge, either
13811381 }
0 commit comments