@@ -11,7 +11,7 @@ use rustc_hir::{
11
11
self as hir, Expr , ExprKind , FnRetTy , FnSig , GenericArgsParentheses , GenericParam , GenericParamKind , HirId , Impl ,
12
12
ImplItemKind , Item , ItemKind , Pat , PatKind , Path , QPath , Ty , TyKind ,
13
13
} ;
14
- use rustc_hir_analysis:: hir_ty_to_ty ;
14
+ use rustc_hir_analysis:: lower_ty ;
15
15
use rustc_lint:: { LateContext , LateLintPass } ;
16
16
use rustc_middle:: ty:: Ty as MiddleTy ;
17
17
use rustc_session:: impl_lint_pass;
@@ -193,7 +193,7 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
193
193
}
194
194
195
195
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
197
197
// we can use `cx.typeck_results.node_type(..)` to get the `ty::Ty` from a `hir::Ty`.
198
198
// However the `node_type()` method can *only* be called in bodies.
199
199
if let Some ( & mut StackItem :: Check { ref mut in_body, .. } ) = self . stack . last_mut ( ) {
@@ -224,7 +224,7 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
224
224
&& let ty = if in_body > 0 {
225
225
cx. typeck_results ( ) . node_type ( hir_ty. hir_id )
226
226
} else {
227
- hir_ty_to_ty ( cx. tcx , hir_ty)
227
+ lower_ty ( cx. tcx , hir_ty)
228
228
}
229
229
&& let impl_ty = cx. tcx . type_of ( impl_id) . instantiate_identity ( )
230
230
&& same_type_and_consts ( ty, impl_ty)
0 commit comments