Skip to content

Commit 92b63b8

Browse files
committed
Fix/add doc comments and change FIXME
1 parent b894a6b commit 92b63b8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/librustc/mir/interpret/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub struct GlobalId<'tcx> {
149149
pub promoted: Option<mir::Promoted>,
150150
}
151151

152-
/// The input type for const eval queries. Const eval queries a given both the `ParamEnv` in which
152+
/// The input type for const eval queries. Const eval queries are given both the `ParamEnv` in which
153153
/// the constant is evaluated in and the identifier of the constant.
154154
pub type ConstEvalInput<'tcx> = Canonical<'tcx, ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>>;
155155

src/librustc/ty/sty.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2396,8 +2396,9 @@ impl<'tcx> Const<'tcx> {
23962396
// HACK(eddyb) when substs contain e.g. inference variables,
23972397
// attempt using identity substs instead, that will succeed
23982398
// when the expression doesn't depend on any parameters.
2399-
// FIXME(eddyb) make `const_eval` a canonical query instead,
2400-
// that would properly handle inference variables in `substs`.
2399+
// FIXME(skinny121) to handle inference variables correctly, the inference context
2400+
// needs to be passed into here so that the inference variables can be used within
2401+
// the `const_eval` canonical query.
24012402
if substs.has_local_value() {
24022403
let identity_substs = InternalSubsts::identity_for_item(tcx, did);
24032404
// The `ParamEnv` needs to match the `identity_substs`.

src/librustc_mir/interpret/eval_context.rs

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pub struct InterpCx<'infcx, 'mir, 'tcx, M: Machine<'mir, 'tcx>> {
3434
/// The results of the type checker, from rustc.
3535
pub tcx: TyCtxtAt<'tcx>,
3636

37+
/// The inference context for inference variables that are within this `InterpCx`. Inference
38+
/// variables may be within either the `param_env` or within `substs` of frames. Many operations
39+
/// outside of mir which takes values that may contain variable require this context.
3740
pub(super) infcx: &'infcx InferCtxt<'infcx, 'tcx>,
3841

3942
/// Bounds in scope for polymorphic evaluations.

0 commit comments

Comments
 (0)