@@ -22,7 +22,7 @@ use rustc_infer::infer::region_constraints::{Constraint, RegionConstraintData};
2222use rustc_middle:: middle:: resolve_lifetime as rl;
2323use rustc_middle:: ty:: fold:: TypeFolder ;
2424use rustc_middle:: ty:: InternalSubsts ;
25- use rustc_middle:: ty:: { self , AdtKind , DefIdTree , EarlyBinder , Lift , Ty , TyCtxt } ;
25+ use rustc_middle:: ty:: { self , AdtKind , DefIdTree , EarlyBinder , Ty , TyCtxt } ;
2626use rustc_middle:: { bug, span_bug} ;
2727use rustc_span:: hygiene:: { AstPass , MacroKind } ;
2828use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
@@ -176,8 +176,6 @@ fn clean_poly_trait_ref_with_bindings<'tcx>(
176176 poly_trait_ref : ty:: PolyTraitRef < ' tcx > ,
177177 bindings : ThinVec < TypeBinding > ,
178178) -> GenericBound {
179- let poly_trait_ref = poly_trait_ref. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
180-
181179 // collect any late bound regions
182180 let late_bound_regions: Vec < _ > = cx
183181 . tcx
@@ -417,8 +415,7 @@ fn clean_projection<'tcx>(
417415 cx : & mut DocContext < ' tcx > ,
418416 def_id : Option < DefId > ,
419417) -> Type {
420- let lifted = ty. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
421- let trait_ = clean_trait_ref_with_bindings ( cx, lifted. trait_ref ( cx. tcx ) , ThinVec :: new ( ) ) ;
418+ let trait_ = clean_trait_ref_with_bindings ( cx, ty. trait_ref ( cx. tcx ) , ThinVec :: new ( ) ) ;
422419 let self_type = clean_middle_ty ( ty. self_ty ( ) , cx, None ) ;
423420 let self_def_id = if let Some ( def_id) = def_id {
424421 cx. tcx . opt_parent ( def_id) . or ( Some ( def_id) )
@@ -1552,7 +1549,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
15521549}
15531550
15541551/// Returns `None` if the type could not be normalized
1555- fn normalize < ' tcx > ( cx : & mut DocContext < ' tcx > , ty : Ty < ' _ > ) -> Option < Ty < ' tcx > > {
1552+ fn normalize < ' tcx > ( cx : & mut DocContext < ' tcx > , ty : Ty < ' tcx > ) -> Option < Ty < ' tcx > > {
15561553 // HACK: low-churn fix for #79459 while we wait for a trait normalization fix
15571554 if !cx. tcx . sess . opts . unstable_opts . normalize_docs {
15581555 return None ;
@@ -1563,11 +1560,10 @@ fn normalize<'tcx>(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
15631560 use rustc_middle:: traits:: ObligationCause ;
15641561
15651562 // Try to normalize `<X as Y>::T` to a type
1566- let lifted = ty. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
15671563 let infcx = cx. tcx . infer_ctxt ( ) . build ( ) ;
15681564 let normalized = infcx
15691565 . at ( & ObligationCause :: dummy ( ) , cx. param_env )
1570- . normalize ( lifted )
1566+ . normalize ( ty )
15711567 . map ( |resolved| infcx. resolve_vars_if_possible ( resolved. value ) ) ;
15721568 match normalized {
15731569 Ok ( normalized_value) => {
@@ -1597,8 +1593,7 @@ pub(crate) fn clean_middle_ty<'tcx>(
15971593 ty:: Float ( float_ty) => Primitive ( float_ty. into ( ) ) ,
15981594 ty:: Str => Primitive ( PrimitiveType :: Str ) ,
15991595 ty:: Slice ( ty) => Slice ( Box :: new ( clean_middle_ty ( ty, cx, None ) ) ) ,
1600- ty:: Array ( ty, n) => {
1601- let mut n = cx. tcx . lift ( n) . expect ( "array lift failed" ) ;
1596+ ty:: Array ( ty, mut n) => {
16021597 n = n. eval ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) ;
16031598 let n = print_const ( cx, n) ;
16041599 Array ( Box :: new ( clean_middle_ty ( ty, cx, None ) ) , n)
@@ -1667,8 +1662,6 @@ pub(crate) fn clean_middle_ty<'tcx>(
16671662 . map ( |pb| TypeBinding {
16681663 assoc : projection_to_path_segment (
16691664 pb. skip_binder ( )
1670- . lift_to_tcx ( cx. tcx )
1671- . unwrap ( )
16721665 // HACK(compiler-errors): Doesn't actually matter what self
16731666 // type we put here, because we're only using the GAT's substs.
16741667 . with_self_ty ( cx. tcx , cx. tcx . types . self_param )
@@ -1701,7 +1694,6 @@ pub(crate) fn clean_middle_ty<'tcx>(
17011694 ty:: Opaque ( def_id, substs) => {
17021695 // Grab the "TraitA + TraitB" from `impl TraitA + TraitB`,
17031696 // by looking up the bounds associated with the def_id.
1704- let substs = cx. tcx . lift ( substs) . expect ( "Opaque lift failed" ) ;
17051697 let bounds = cx
17061698 . tcx
17071699 . explicit_item_bounds ( def_id)
0 commit comments