Skip to content

Commit 806c728

Browse files
committed
add comment to visit_ct_substs
1 parent 71d7550 commit 806c728

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/rustc_infer/src/infer/combine.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,7 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
881881
}
882882
}
883883
}
884-
ty::Infer(ty::IntVar(_) | ty::FloatVar(_)) => {
885-
Ok(t)
886-
}
884+
ty::Infer(ty::IntVar(_) | ty::FloatVar(_)) => Ok(t),
887885
_ => relate::super_relate_tys(self, t, t),
888886
}
889887
}

compiler/rustc_middle/src/ty/relate.rs

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ pub trait TypeRelation<'tcx>: Sized {
3333
/// relation. Just affects error messages.
3434
fn a_is_expected(&self) -> bool;
3535

36+
/// Whether we should look into the substs of unevaluated constants
37+
/// even if `feature(const_evaluatable_checked)` is active.
38+
///
39+
/// This is needed in `combine` to prevent accidentially creating
40+
/// infinite types as we abuse `TypeRelation` to walk a type there.
3641
fn visit_ct_substs(&self) -> bool {
3742
false
3843
}

0 commit comments

Comments
 (0)