Skip to content

Commit b6144e7

Browse files
committed
yeet ya fixme into the void
1 parent 68405fd commit b6144e7

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

compiler/rustc_infer/src/infer/canonical/query_response.rs

+4
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,10 @@ struct QueryTypeRelatingDelegate<'a, 'tcx> {
639639
}
640640

641641
impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
642+
fn param_env(&self) -> ty::ParamEnv<'tcx> {
643+
self.param_env
644+
}
645+
642646
fn create_next_universe(&mut self) -> ty::UniverseIndex {
643647
self.infcx.create_next_universe()
644648
}

compiler/rustc_infer/src/infer/nll_relate/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ where
7272
}
7373

7474
pub trait TypeRelatingDelegate<'tcx> {
75+
fn param_env(&self) -> ty::ParamEnv<'tcx>;
76+
7577
/// Push a constraint `sup: sub` -- this constraint must be
7678
/// satisfied for the two types to be related. `sub` and `sup` may
7779
/// be regions from the type or new variables created through the
@@ -473,9 +475,8 @@ where
473475
self.infcx.tcx
474476
}
475477

476-
// FIXME(oli-obk): not sure how to get the correct ParamEnv
477478
fn param_env(&self) -> ty::ParamEnv<'tcx> {
478-
ty::ParamEnv::empty()
479+
self.delegate.param_env()
479480
}
480481

481482
fn tag(&self) -> &'static str {
@@ -819,9 +820,8 @@ where
819820
self.infcx.tcx
820821
}
821822

822-
// FIXME(oli-obk): not sure how to get the correct ParamEnv
823823
fn param_env(&self) -> ty::ParamEnv<'tcx> {
824-
ty::ParamEnv::empty()
824+
self.delegate.param_env()
825825
}
826826

827827
fn tag(&self) -> &'static str {

compiler/rustc_mir/src/borrow_check/type_check/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
10981098
) -> Fallible<()> {
10991099
relate_tys::relate_types(
11001100
self.infcx,
1101+
self.param_env,
11011102
a,
11021103
v,
11031104
b,

compiler/rustc_mir/src/borrow_check/type_check/relate_tys.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use crate::borrow_check::type_check::{BorrowCheckContext, Locations};
1818
/// variables, but not the type `b`.
1919
pub(super) fn relate_types<'tcx>(
2020
infcx: &InferCtxt<'_, 'tcx>,
21+
param_env: ty::ParamEnv<'tcx>,
2122
a: Ty<'tcx>,
2223
v: ty::Variance,
2324
b: Ty<'tcx>,
@@ -28,7 +29,7 @@ pub(super) fn relate_types<'tcx>(
2829
debug!("relate_types(a={:?}, v={:?}, b={:?}, locations={:?})", a, v, b, locations);
2930
TypeRelating::new(
3031
infcx,
31-
NllTypeRelatingDelegate::new(infcx, borrowck_context, locations, category),
32+
NllTypeRelatingDelegate::new(infcx, borrowck_context, param_env, locations, category),
3233
v,
3334
)
3435
.relate(a, b)?;
@@ -39,6 +40,8 @@ struct NllTypeRelatingDelegate<'me, 'bccx, 'tcx> {
3940
infcx: &'me InferCtxt<'me, 'tcx>,
4041
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,
4142

43+
param_env: ty::ParamEnv<'tcx>,
44+
4245
/// Where (and why) is this relation taking place?
4346
locations: Locations,
4447

@@ -50,14 +53,19 @@ impl NllTypeRelatingDelegate<'me, 'bccx, 'tcx> {
5053
fn new(
5154
infcx: &'me InferCtxt<'me, 'tcx>,
5255
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,
56+
param_env: ty::ParamEnv<'tcx>,
5357
locations: Locations,
5458
category: ConstraintCategory,
5559
) -> Self {
56-
Self { infcx, borrowck_context, locations, category }
60+
Self { infcx, borrowck_context, param_env, locations, category }
5761
}
5862
}
5963

6064
impl TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx> {
65+
fn param_env(&self) -> ty::ParamEnv<'tcx> {
66+
self.param_env
67+
}
68+
6169
fn create_next_universe(&mut self) -> ty::UniverseIndex {
6270
self.infcx.create_next_universe()
6371
}

0 commit comments

Comments
 (0)