Skip to content

Commit 23f26b1

Browse files
lift_to_tcx -> lift_to_interner
1 parent cae4a84 commit 23f26b1

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

compiler/rustc_macros/src/lift.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStre
4545
quote! {
4646
type Lifted = #lifted;
4747

48-
fn lift_to_tcx(self, __tcx: ::rustc_middle::ty::TyCtxt<'__lifted>) -> Option<#lifted> {
48+
fn lift_to_interner(self, __tcx: ::rustc_middle::ty::TyCtxt<'__lifted>) -> Option<#lifted> {
4949
Some(match self { #body })
5050
}
5151
},

compiler/rustc_middle/src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ macro_rules! TrivialLiftImpls {
5959
$(
6060
impl<'tcx> $crate::ty::Lift<$crate::ty::TyCtxt<'tcx>> for $ty {
6161
type Lifted = Self;
62-
fn lift_to_tcx(self, _: $crate::ty::TyCtxt<'tcx>) -> Option<Self> {
62+
fn lift_to_interner(self, _: $crate::ty::TyCtxt<'tcx>) -> Option<Self> {
6363
Some(self)
6464
}
6565
}

compiler/rustc_middle/src/ty/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ impl<'tcx> TyCtxt<'tcx> {
14831483
}
14841484

14851485
pub fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted> {
1486-
value.lift_to_tcx(self)
1486+
value.lift_to_interner(self)
14871487
}
14881488

14891489
/// Creates a type context. To use the context call `fn enter` which
@@ -2086,7 +2086,7 @@ macro_rules! nop_lift {
20862086
($set:ident; $ty:ty => $lifted:ty) => {
20872087
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
20882088
type Lifted = $lifted;
2089-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
2089+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
20902090
// Assert that the set has the right type.
20912091
// Given an argument that has an interned type, the return type has the type of
20922092
// the corresponding interner set. This won't actually return anything, we're
@@ -2121,7 +2121,7 @@ macro_rules! nop_list_lift {
21212121
($set:ident; $ty:ty => $lifted:ty) => {
21222122
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> {
21232123
type Lifted = &'tcx List<$lifted>;
2124-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
2124+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
21252125
// Assert that the set has the right type.
21262126
if false {
21272127
let _x: &InternedSet<'tcx, List<$lifted>> = &tcx.interners.$set;
@@ -2159,7 +2159,7 @@ macro_rules! nop_slice_lift {
21592159
($ty:ty => $lifted:ty) => {
21602160
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a [$ty] {
21612161
type Lifted = &'tcx [$lifted];
2162-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
2162+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
21632163
if self.is_empty() {
21642164
return Some(&[]);
21652165
}

compiler/rustc_middle/src/ty/generic_args.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl<'tcx> GenericArg<'tcx> {
308308
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for GenericArg<'a> {
309309
type Lifted = GenericArg<'tcx>;
310310

311-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
311+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
312312
match self.unpack() {
313313
GenericArgKind::Lifetime(lt) => tcx.lift(lt).map(|lt| lt.into()),
314314
GenericArgKind::Type(ty) => tcx.lift(ty).map(|ty| ty.into()),

compiler/rustc_middle/src/ty/structural_impls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ TrivialTypeTraversalAndLiftImpls! {
284284

285285
impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
286286
type Lifted = Option<T::Lifted>;
287-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
287+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
288288
Some(match self {
289289
Some(x) => Some(tcx.lift(x)?),
290290
None => None,
@@ -294,7 +294,7 @@ impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
294294

295295
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for Term<'a> {
296296
type Lifted = ty::Term<'tcx>;
297-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
297+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
298298
match self.unpack() {
299299
TermKind::Ty(ty) => tcx.lift(ty).map(Into::into),
300300
TermKind::Const(c) => tcx.lift(c).map(Into::into),

compiler/rustc_type_ir/src/binder.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ where
4949
{
5050
type Lifted = Binder<U, T::Lifted>;
5151

52-
fn lift_to_tcx(self, tcx: U) -> Option<Self::Lifted> {
52+
fn lift_to_interner(self, tcx: U) -> Option<Self::Lifted> {
5353
Some(Binder {
54-
value: self.value.lift_to_tcx(tcx)?,
55-
bound_vars: self.bound_vars.lift_to_tcx(tcx)?,
54+
value: self.value.lift_to_interner(tcx)?,
55+
bound_vars: self.bound_vars.lift_to_interner(tcx)?,
5656
})
5757
}
5858
}

compiler/rustc_type_ir/src/lift.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
/// e.g., `()` or `u8`, was interned in a different context.
1818
pub trait Lift<I>: std::fmt::Debug {
1919
type Lifted: std::fmt::Debug;
20-
fn lift_to_tcx(self, tcx: I) -> Option<Self::Lifted>;
20+
fn lift_to_interner(self, tcx: I) -> Option<Self::Lifted>;
2121
}

compiler/rustc_type_ir/src/predicate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ where
3434
{
3535
type Lifted = OutlivesPredicate<U, A::Lifted>;
3636

37-
fn lift_to_tcx(self, tcx: U) -> Option<Self::Lifted> {
38-
Some(OutlivesPredicate(self.0.lift_to_tcx(tcx)?, self.1.lift_to_tcx(tcx)?))
37+
fn lift_to_interner(self, tcx: U) -> Option<Self::Lifted> {
38+
Some(OutlivesPredicate(self.0.lift_to_interner(tcx)?, self.1.lift_to_interner(tcx)?))
3939
}
4040
}
4141

compiler/rustc_type_ir_macros/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
7171
wc.push(parse_quote! { #ty: ::rustc_type_ir::lift::Lift<J, Lifted = #lifted_ty> });
7272
let bind = &bindings[index];
7373
quote! {
74-
#bind.lift_to_tcx(interner)?
74+
#bind.lift_to_interner(interner)?
7575
}
7676
})
7777
});
@@ -89,7 +89,7 @@ fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
8989
quote! {
9090
type Lifted = #lifted_ty;
9191

92-
fn lift_to_tcx(
92+
fn lift_to_interner(
9393
self,
9494
interner: J,
9595
) -> Option<Self::Lifted> {

0 commit comments

Comments
 (0)