Skip to content

Commit a651050

Browse files
lift_to_tcx -> lift_to_interner
1 parent 3de0a7c commit a651050

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
@@ -1484,7 +1484,7 @@ impl<'tcx> TyCtxt<'tcx> {
14841484
}
14851485

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

14901490
/// Creates a type context. To use the context call `fn enter` which
@@ -2087,7 +2087,7 @@ macro_rules! nop_lift {
20872087
($set:ident; $ty:ty => $lifted:ty) => {
20882088
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
20892089
type Lifted = $lifted;
2090-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
2090+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
20912091
// Assert that the set has the right type.
20922092
// Given an argument that has an interned type, the return type has the type of
20932093
// the corresponding interner set. This won't actually return anything, we're
@@ -2122,7 +2122,7 @@ macro_rules! nop_list_lift {
21222122
($set:ident; $ty:ty => $lifted:ty) => {
21232123
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> {
21242124
type Lifted = &'tcx List<$lifted>;
2125-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
2125+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
21262126
// Assert that the set has the right type.
21272127
if false {
21282128
let _x: &InternedSet<'tcx, List<$lifted>> = &tcx.interners.$set;
@@ -2160,7 +2160,7 @@ macro_rules! nop_slice_lift {
21602160
($ty:ty => $lifted:ty) => {
21612161
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a [$ty] {
21622162
type Lifted = &'tcx [$lifted];
2163-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
2163+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
21642164
if self.is_empty() {
21652165
return Some(&[]);
21662166
}

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
@@ -283,7 +283,7 @@ TrivialTypeTraversalAndLiftImpls! {
283283

284284
impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
285285
type Lifted = Option<T::Lifted>;
286-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
286+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
287287
Some(match self {
288288
Some(x) => Some(tcx.lift(x)?),
289289
None => None,
@@ -293,7 +293,7 @@ impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
293293

294294
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for Term<'a> {
295295
type Lifted = ty::Term<'tcx>;
296-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
296+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
297297
match self.unpack() {
298298
TermKind::Ty(ty) => tcx.lift(ty).map(Into::into),
299299
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)