Make THIR building a stealable query
This commit is contained in:
@@ -13,6 +13,7 @@ use crate::middle::resolve_lifetime::{self, LifetimeScopeForPath, ObjectLifetime
|
||||
use crate::middle::stability;
|
||||
use crate::mir::interpret::{self, Allocation, ConstValue, Scalar};
|
||||
use crate::mir::{Body, Field, Local, Place, PlaceElem, ProjectionKind, Promoted};
|
||||
use crate::thir::Thir;
|
||||
use crate::traits;
|
||||
use crate::ty::query::{self, OnDiskCache, TyCtxtAt};
|
||||
use crate::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, Subst, SubstsRef, UserSubsts};
|
||||
@@ -1041,6 +1042,10 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn alloc_steal_thir(self, thir: Thir<'tcx>) -> &'tcx Steal<Thir<'tcx>> {
|
||||
self.arena.alloc(Steal::new(thir))
|
||||
}
|
||||
|
||||
pub fn alloc_steal_mir(self, mir: Body<'tcx>) -> &'tcx Steal<Body<'tcx>> {
|
||||
self.arena.alloc(Steal::new(mir))
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ use crate::mir::interpret::GlobalId;
|
||||
use crate::mir::interpret::{ConstAlloc, LitToConstError, LitToConstInput};
|
||||
use crate::mir::interpret::{ConstValue, EvalToAllocationRawResult, EvalToConstValueResult};
|
||||
use crate::mir::mono::CodegenUnit;
|
||||
use crate::thir;
|
||||
use crate::traits::query::{
|
||||
CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal,
|
||||
CanonicalTypeOpAscribeUserTypeGoal, CanonicalTypeOpEqGoal, CanonicalTypeOpNormalizeGoal,
|
||||
|
||||
@@ -669,7 +669,7 @@ impl<'tcx> GeneratorSubsts<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Copy, Clone, HashStable)]
|
||||
pub enum UpvarSubsts<'tcx> {
|
||||
Closure(SubstsRef<'tcx>),
|
||||
Generator(SubstsRef<'tcx>),
|
||||
|
||||
Reference in New Issue
Block a user