yeet ya fixme into the void
This commit is contained in:
parent
68405fdc2e
commit
b6144e7a20
4 changed files with 19 additions and 6 deletions
|
@ -639,6 +639,10 @@ struct QueryTypeRelatingDelegate<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
|
impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
|
||||||
|
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
||||||
|
self.param_env
|
||||||
|
}
|
||||||
|
|
||||||
fn create_next_universe(&mut self) -> ty::UniverseIndex {
|
fn create_next_universe(&mut self) -> ty::UniverseIndex {
|
||||||
self.infcx.create_next_universe()
|
self.infcx.create_next_universe()
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,8 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait TypeRelatingDelegate<'tcx> {
|
pub trait TypeRelatingDelegate<'tcx> {
|
||||||
|
fn param_env(&self) -> ty::ParamEnv<'tcx>;
|
||||||
|
|
||||||
/// Push a constraint `sup: sub` -- this constraint must be
|
/// Push a constraint `sup: sub` -- this constraint must be
|
||||||
/// satisfied for the two types to be related. `sub` and `sup` may
|
/// satisfied for the two types to be related. `sub` and `sup` may
|
||||||
/// be regions from the type or new variables created through the
|
/// be regions from the type or new variables created through the
|
||||||
|
@ -473,9 +475,8 @@ where
|
||||||
self.infcx.tcx
|
self.infcx.tcx
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(oli-obk): not sure how to get the correct ParamEnv
|
|
||||||
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
||||||
ty::ParamEnv::empty()
|
self.delegate.param_env()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tag(&self) -> &'static str {
|
fn tag(&self) -> &'static str {
|
||||||
|
@ -819,9 +820,8 @@ where
|
||||||
self.infcx.tcx
|
self.infcx.tcx
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(oli-obk): not sure how to get the correct ParamEnv
|
|
||||||
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
||||||
ty::ParamEnv::empty()
|
self.delegate.param_env()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tag(&self) -> &'static str {
|
fn tag(&self) -> &'static str {
|
||||||
|
|
|
@ -1098,6 +1098,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
) -> Fallible<()> {
|
) -> Fallible<()> {
|
||||||
relate_tys::relate_types(
|
relate_tys::relate_types(
|
||||||
self.infcx,
|
self.infcx,
|
||||||
|
self.param_env,
|
||||||
a,
|
a,
|
||||||
v,
|
v,
|
||||||
b,
|
b,
|
||||||
|
|
|
@ -18,6 +18,7 @@ use crate::borrow_check::type_check::{BorrowCheckContext, Locations};
|
||||||
/// variables, but not the type `b`.
|
/// variables, but not the type `b`.
|
||||||
pub(super) fn relate_types<'tcx>(
|
pub(super) fn relate_types<'tcx>(
|
||||||
infcx: &InferCtxt<'_, 'tcx>,
|
infcx: &InferCtxt<'_, 'tcx>,
|
||||||
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
a: Ty<'tcx>,
|
a: Ty<'tcx>,
|
||||||
v: ty::Variance,
|
v: ty::Variance,
|
||||||
b: Ty<'tcx>,
|
b: Ty<'tcx>,
|
||||||
|
@ -28,7 +29,7 @@ pub(super) fn relate_types<'tcx>(
|
||||||
debug!("relate_types(a={:?}, v={:?}, b={:?}, locations={:?})", a, v, b, locations);
|
debug!("relate_types(a={:?}, v={:?}, b={:?}, locations={:?})", a, v, b, locations);
|
||||||
TypeRelating::new(
|
TypeRelating::new(
|
||||||
infcx,
|
infcx,
|
||||||
NllTypeRelatingDelegate::new(infcx, borrowck_context, locations, category),
|
NllTypeRelatingDelegate::new(infcx, borrowck_context, param_env, locations, category),
|
||||||
v,
|
v,
|
||||||
)
|
)
|
||||||
.relate(a, b)?;
|
.relate(a, b)?;
|
||||||
|
@ -39,6 +40,8 @@ struct NllTypeRelatingDelegate<'me, 'bccx, 'tcx> {
|
||||||
infcx: &'me InferCtxt<'me, 'tcx>,
|
infcx: &'me InferCtxt<'me, 'tcx>,
|
||||||
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,
|
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,
|
||||||
|
|
||||||
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
|
|
||||||
/// Where (and why) is this relation taking place?
|
/// Where (and why) is this relation taking place?
|
||||||
locations: Locations,
|
locations: Locations,
|
||||||
|
|
||||||
|
@ -50,14 +53,19 @@ impl NllTypeRelatingDelegate<'me, 'bccx, 'tcx> {
|
||||||
fn new(
|
fn new(
|
||||||
infcx: &'me InferCtxt<'me, 'tcx>,
|
infcx: &'me InferCtxt<'me, 'tcx>,
|
||||||
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,
|
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,
|
||||||
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
locations: Locations,
|
locations: Locations,
|
||||||
category: ConstraintCategory,
|
category: ConstraintCategory,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self { infcx, borrowck_context, locations, category }
|
Self { infcx, borrowck_context, param_env, locations, category }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx> {
|
impl TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx> {
|
||||||
|
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
||||||
|
self.param_env
|
||||||
|
}
|
||||||
|
|
||||||
fn create_next_universe(&mut self) -> ty::UniverseIndex {
|
fn create_next_universe(&mut self) -> ty::UniverseIndex {
|
||||||
self.infcx.create_next_universe()
|
self.infcx.create_next_universe()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue