@@ -11,7 +11,7 @@ use rustc_hir::{
1111 self as hir, Expr , ExprKind , FnRetTy , FnSig , GenericArgsParentheses , GenericParam , GenericParamKind , HirId , Impl ,
1212 ImplItemKind , Item , ItemKind , Pat , PatKind , Path , QPath , Ty , TyKind ,
1313} ;
14- use rustc_hir_analysis:: hir_ty_to_ty ;
14+ use rustc_hir_analysis:: lower_ty ;
1515use rustc_lint:: { LateContext , LateLintPass } ;
1616use rustc_middle:: ty:: Ty as MiddleTy ;
1717use rustc_session:: impl_lint_pass;
@@ -193,7 +193,7 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
193193 }
194194
195195 fn check_body ( & mut self , _: & LateContext < ' _ > , _: & hir:: Body < ' _ > ) {
196- // `hir_ty_to_ty ` cannot be called in `Body`s or it will panic (sometimes). But in bodies
196+ // `lower_ty ` cannot be called in `Body`s or it will panic (sometimes). But in bodies
197197 // we can use `cx.typeck_results.node_type(..)` to get the `ty::Ty` from a `hir::Ty`.
198198 // However the `node_type()` method can *only* be called in bodies.
199199 if let Some ( & mut StackItem :: Check { ref mut in_body, .. } ) = self . stack . last_mut ( ) {
@@ -224,7 +224,7 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
224224 && let ty = if in_body > 0 {
225225 cx. typeck_results ( ) . node_type ( hir_ty. hir_id )
226226 } else {
227- hir_ty_to_ty ( cx. tcx , hir_ty)
227+ lower_ty ( cx. tcx , hir_ty)
228228 }
229229 && let impl_ty = cx. tcx . type_of ( impl_id) . instantiate_identity ( )
230230 && same_type_and_consts ( ty, impl_ty)
0 commit comments