Uplift CanonicalVarInfo and friends
This commit is contained in:
@@ -1517,8 +1517,36 @@ pub struct Placeholder<T> {
|
||||
|
||||
pub type PlaceholderRegion = Placeholder<BoundRegion>;
|
||||
|
||||
impl rustc_type_ir::Placeholder for PlaceholderRegion {
|
||||
fn universe(&self) -> UniverseIndex {
|
||||
self.universe
|
||||
}
|
||||
|
||||
fn var(&self) -> BoundVar {
|
||||
self.bound.var
|
||||
}
|
||||
|
||||
fn with_updated_universe(self, ui: UniverseIndex) -> Self {
|
||||
Placeholder { universe: ui, ..self }
|
||||
}
|
||||
}
|
||||
|
||||
pub type PlaceholderType = Placeholder<BoundTy>;
|
||||
|
||||
impl rustc_type_ir::Placeholder for PlaceholderType {
|
||||
fn universe(&self) -> UniverseIndex {
|
||||
self.universe
|
||||
}
|
||||
|
||||
fn var(&self) -> BoundVar {
|
||||
self.bound.var
|
||||
}
|
||||
|
||||
fn with_updated_universe(self, ui: UniverseIndex) -> Self {
|
||||
Placeholder { universe: ui, ..self }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, HashStable)]
|
||||
#[derive(TyEncodable, TyDecodable, PartialOrd, Ord)]
|
||||
pub struct BoundConst<'tcx> {
|
||||
@@ -1528,6 +1556,20 @@ pub struct BoundConst<'tcx> {
|
||||
|
||||
pub type PlaceholderConst = Placeholder<BoundVar>;
|
||||
|
||||
impl rustc_type_ir::Placeholder for PlaceholderConst {
|
||||
fn universe(&self) -> UniverseIndex {
|
||||
self.universe
|
||||
}
|
||||
|
||||
fn var(&self) -> BoundVar {
|
||||
self.bound
|
||||
}
|
||||
|
||||
fn with_updated_universe(self, ui: UniverseIndex) -> Self {
|
||||
Placeholder { universe: ui, ..self }
|
||||
}
|
||||
}
|
||||
|
||||
/// When type checking, we use the `ParamEnv` to track
|
||||
/// details about the set of where-clauses that are in scope at this
|
||||
/// particular point.
|
||||
|
||||
Reference in New Issue
Block a user