Skip to content

Commit b8bbee6

Browse files
committed
fixup
1 parent 4845b35 commit b8bbee6

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

compiler/rustc_infer/src/infer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11551155
self.next_region_var_in_universe(RegionVariableOrigin::Nll(origin), universe)
11561156
}
11571157

1158-
pub fn var_for_def(&self, span: Span, param: &ty::GenericParamDef) -> GenericArg<'tcx> {
1158+
pub fn var_for_def(&self, span: Span, param: &ty::GenericParamDef, constness: Option<ty::ConstnessArg>) -> GenericArg<'tcx> {
11591159
match param.kind {
11601160
GenericParamDefKind::Lifetime => {
11611161
// Create a region inference variable for the given
@@ -1206,7 +1206,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
12061206
/// Given a set of generics defined on a type or impl, returns a substitution mapping each
12071207
/// type/region parameter to a fresh inference variable.
12081208
pub fn fresh_substs_for_item(&self, span: Span, def_id: DefId) -> SubstsRef<'tcx> {
1209-
InternalSubsts::for_item(self.tcx, def_id, |param, _| self.var_for_def(span, param))
1209+
InternalSubsts::for_item(self.tcx, def_id, |param, _| self.var_for_def(span, param, None))
12101210
}
12111211

12121212
/// Returns `true` if errors have been reported since this infcx was

compiler/rustc_infer/src/infer/outlives/test_type_match.rs

+9
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,13 @@ impl<'tcx> TypeRelation<'tcx> for Match<'tcx> {
204204
self.pattern_depth.shift_out(1);
205205
result
206206
}
207+
208+
fn constness_args(
209+
&mut self,
210+
a: ty::ConstnessArg,
211+
b: ty::ConstnessArg,
212+
) -> RelateResult<'tcx, ty::ConstnessArg> {
213+
// TODO
214+
relate::super_relate_constness(self, a, b)
215+
}
207216
}

compiler/rustc_middle/src/mir/interpret/queries.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ impl<'tcx> TyCtxtEnsure<'tcx> {
180180
let substs = InternalSubsts::identity_for_item(self.tcx, def_id);
181181
let instance = ty::Instance::new(def_id, substs);
182182
let cid = GlobalId { instance, promoted: None };
183-
let param_env =
184-
self.tcx.param_env(def_id).with_reveal_all_normalized(self.tcx).with_const();
183+
let param_env = self.tcx.param_env(def_id).with_reveal_all_normalized(self.tcx);
185184
// Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
186185
// improve caching of queries.
187186
let inputs = self.tcx.erase_regions(param_env.and(cid));
@@ -194,7 +193,7 @@ impl<'tcx> TyCtxtEnsure<'tcx> {
194193
assert!(self.tcx.is_static(def_id));
195194
let instance = ty::Instance::mono(self.tcx, def_id);
196195
let gid = GlobalId { instance, promoted: None };
197-
let param_env = ty::ParamEnv::reveal_all().with_const();
196+
let param_env = ty::ParamEnv::reveal_all();
198197
trace!("eval_to_allocation: Need to compute {:?}", gid);
199198
self.eval_to_allocation_raw(param_env.and(gid))
200199
}

compiler/rustc_middle/src/ty/visit.rs

+4
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ pub trait TypeVisitor<'tcx>: Sized {
210210
fn visit_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> ControlFlow<Self::BreakTy> {
211211
c.super_visit_with(self)
212212
}
213+
214+
fn visit_constness_arg(&mut self, c: ty::ConstnessArg) -> ControlFlow<Self::BreakTy> {
215+
c.super_visit_with(self)
216+
}
213217
}
214218

215219
///////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)