Skip to content

Commit

Permalink
add comment to visit_ct_substs
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Dec 2, 2020
1 parent 71d7550 commit 806c728
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_infer/src/infer/combine.rs
Expand Up @@ -881,9 +881,7 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
}
}
}
ty::Infer(ty::IntVar(_) | ty::FloatVar(_)) => {
Ok(t)
}
ty::Infer(ty::IntVar(_) | ty::FloatVar(_)) => Ok(t),
_ => relate::super_relate_tys(self, t, t),
}
}
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_middle/src/ty/relate.rs
Expand Up @@ -33,6 +33,11 @@ pub trait TypeRelation<'tcx>: Sized {
/// relation. Just affects error messages.
fn a_is_expected(&self) -> bool;

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

0 comments on commit 806c728

Please sign in to comment.