@@ -22,7 +22,7 @@ use rustc_infer::infer::region_constraints::{Constraint, RegionConstraintData};
22
22
use rustc_middle:: middle:: resolve_lifetime as rl;
23
23
use rustc_middle:: ty:: fold:: TypeFolder ;
24
24
use 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 } ;
26
26
use rustc_middle:: { bug, span_bug} ;
27
27
use rustc_span:: hygiene:: { AstPass , MacroKind } ;
28
28
use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
@@ -176,8 +176,6 @@ fn clean_poly_trait_ref_with_bindings<'tcx>(
176
176
poly_trait_ref : ty:: PolyTraitRef < ' tcx > ,
177
177
bindings : ThinVec < TypeBinding > ,
178
178
) -> GenericBound {
179
- let poly_trait_ref = poly_trait_ref. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
180
-
181
179
// collect any late bound regions
182
180
let late_bound_regions: Vec < _ > = cx
183
181
. tcx
@@ -417,8 +415,7 @@ fn clean_projection<'tcx>(
417
415
cx : & mut DocContext < ' tcx > ,
418
416
def_id : Option < DefId > ,
419
417
) -> 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 ( ) ) ;
422
419
let self_type = clean_middle_ty ( ty. self_ty ( ) , cx, None ) ;
423
420
let self_def_id = if let Some ( def_id) = def_id {
424
421
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
1552
1549
}
1553
1550
1554
1551
/// 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 > > {
1556
1553
// HACK: low-churn fix for #79459 while we wait for a trait normalization fix
1557
1554
if !cx. tcx . sess . opts . unstable_opts . normalize_docs {
1558
1555
return None ;
@@ -1563,11 +1560,10 @@ fn normalize<'tcx>(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
1563
1560
use rustc_middle:: traits:: ObligationCause ;
1564
1561
1565
1562
// Try to normalize `<X as Y>::T` to a type
1566
- let lifted = ty. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
1567
1563
let infcx = cx. tcx . infer_ctxt ( ) . build ( ) ;
1568
1564
let normalized = infcx
1569
1565
. at ( & ObligationCause :: dummy ( ) , cx. param_env )
1570
- . normalize ( lifted )
1566
+ . normalize ( ty )
1571
1567
. map ( |resolved| infcx. resolve_vars_if_possible ( resolved. value ) ) ;
1572
1568
match normalized {
1573
1569
Ok ( normalized_value) => {
@@ -1597,8 +1593,7 @@ pub(crate) fn clean_middle_ty<'tcx>(
1597
1593
ty:: Float ( float_ty) => Primitive ( float_ty. into ( ) ) ,
1598
1594
ty:: Str => Primitive ( PrimitiveType :: Str ) ,
1599
1595
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) => {
1602
1597
n = n. eval ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) ;
1603
1598
let n = print_const ( cx, n) ;
1604
1599
Array ( Box :: new ( clean_middle_ty ( ty, cx, None ) ) , n)
@@ -1667,8 +1662,6 @@ pub(crate) fn clean_middle_ty<'tcx>(
1667
1662
. map ( |pb| TypeBinding {
1668
1663
assoc : projection_to_path_segment (
1669
1664
pb. skip_binder ( )
1670
- . lift_to_tcx ( cx. tcx )
1671
- . unwrap ( )
1672
1665
// HACK(compiler-errors): Doesn't actually matter what self
1673
1666
// type we put here, because we're only using the GAT's substs.
1674
1667
. with_self_ty ( cx. tcx , cx. tcx . types . self_param )
@@ -1701,7 +1694,6 @@ pub(crate) fn clean_middle_ty<'tcx>(
1701
1694
ty:: Opaque ( def_id, substs) => {
1702
1695
// Grab the "TraitA + TraitB" from `impl TraitA + TraitB`,
1703
1696
// by looking up the bounds associated with the def_id.
1704
- let substs = cx. tcx . lift ( substs) . expect ( "Opaque lift failed" ) ;
1705
1697
let bounds = cx
1706
1698
. tcx
1707
1699
. explicit_item_bounds ( def_id)
0 commit comments