Rollup merge of #127810 - compiler-errors:less-tcx, r=lcnr
Rename `tcx` to `cx` in `rustc_type_ir` Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol. r? lcnr
This commit is contained in:
commit
b2b14deca5
29 changed files with 185 additions and 188 deletions
|
@ -59,7 +59,7 @@ macro_rules! TrivialLiftImpls {
|
|||
$(
|
||||
impl<'tcx> $crate::ty::Lift<$crate::ty::TyCtxt<'tcx>> for $ty {
|
||||
type Lifted = Self;
|
||||
fn lift_to_tcx(self, _: $crate::ty::TyCtxt<'tcx>) -> Option<Self> {
|
||||
fn lift_to_interner(self, _: $crate::ty::TyCtxt<'tcx>) -> Option<Self> {
|
||||
Some(self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1484,7 +1484,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
}
|
||||
|
||||
pub fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted> {
|
||||
value.lift_to_tcx(self)
|
||||
value.lift_to_interner(self)
|
||||
}
|
||||
|
||||
/// Creates a type context. To use the context call `fn enter` which
|
||||
|
@ -2087,7 +2087,7 @@ macro_rules! nop_lift {
|
|||
($set:ident; $ty:ty => $lifted:ty) => {
|
||||
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty {
|
||||
type Lifted = $lifted;
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
// Assert that the set has the right type.
|
||||
// Given an argument that has an interned type, the return type has the type of
|
||||
// the corresponding interner set. This won't actually return anything, we're
|
||||
|
@ -2122,7 +2122,7 @@ macro_rules! nop_list_lift {
|
|||
($set:ident; $ty:ty => $lifted:ty) => {
|
||||
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> {
|
||||
type Lifted = &'tcx List<$lifted>;
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
// Assert that the set has the right type.
|
||||
if false {
|
||||
let _x: &InternedSet<'tcx, List<$lifted>> = &tcx.interners.$set;
|
||||
|
@ -2160,7 +2160,7 @@ macro_rules! nop_slice_lift {
|
|||
($ty:ty => $lifted:ty) => {
|
||||
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a [$ty] {
|
||||
type Lifted = &'tcx [$lifted];
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
if self.is_empty() {
|
||||
return Some(&[]);
|
||||
}
|
||||
|
|
|
@ -308,7 +308,7 @@ impl<'tcx> GenericArg<'tcx> {
|
|||
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for GenericArg<'a> {
|
||||
type Lifted = GenericArg<'tcx>;
|
||||
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
match self.unpack() {
|
||||
GenericArgKind::Lifetime(lt) => tcx.lift(lt).map(|lt| lt.into()),
|
||||
GenericArgKind::Type(ty) => tcx.lift(ty).map(|ty| ty.into()),
|
||||
|
|
|
@ -69,7 +69,7 @@ impl<'tcx> Relate<TyCtxt<'tcx>> for ty::Pattern<'tcx> {
|
|||
if inc_a != inc_b {
|
||||
todo!()
|
||||
}
|
||||
Ok(relation.tcx().mk_pat(ty::PatternKind::Range { start, end, include_end: inc_a }))
|
||||
Ok(relation.cx().mk_pat(ty::PatternKind::Range { start, end, include_end: inc_a }))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ impl<'tcx> Relate<TyCtxt<'tcx>> for &'tcx ty::List<ty::PolyExistentialPredicate<
|
|||
a: Self,
|
||||
b: Self,
|
||||
) -> RelateResult<'tcx, Self> {
|
||||
let tcx = relation.tcx();
|
||||
let tcx = relation.cx();
|
||||
|
||||
// FIXME: this is wasteful, but want to do a perf run to see how slow it is.
|
||||
// We need to perform this deduplication as we sometimes generate duplicate projections
|
||||
|
|
|
@ -283,7 +283,7 @@ TrivialTypeTraversalAndLiftImpls! {
|
|||
|
||||
impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
|
||||
type Lifted = Option<T::Lifted>;
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
Some(match self {
|
||||
Some(x) => Some(tcx.lift(x)?),
|
||||
None => None,
|
||||
|
@ -293,7 +293,7 @@ impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
|
|||
|
||||
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for Term<'a> {
|
||||
type Lifted = ty::Term<'tcx>;
|
||||
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
|
||||
match self.unpack() {
|
||||
TermKind::Ty(ty) => tcx.lift(ty).map(Into::into),
|
||||
TermKind::Const(c) => tcx.lift(c).map(Into::into),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue