diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2021-01-24 20:08:12 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2021-03-27 16:38:23 +0100 |
| commit | 42150fb8a12cae86ebee3a7734c2d14ed6b1d0a8 (patch) | |
| tree | 10a92159d7197f7bb0e500faab3b042964dcc63c /compiler/rustc_middle/src | |
| parent | aef11409b43a533f4e59ffb9b0efcb619c6e6879 (diff) | |
| download | rust-42150fb8a12cae86ebee3a7734c2d14ed6b1d0a8.tar.gz rust-42150fb8a12cae86ebee3a7734c2d14ed6b1d0a8.zip | |
combine: stop eagerly evaluating consts
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/relate.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_middle/src/ty/relate.rs b/compiler/rustc_middle/src/ty/relate.rs index c936c30f456..32a713beef8 100644 --- a/compiler/rustc_middle/src/ty/relate.rs +++ b/compiler/rustc_middle/src/ty/relate.rs @@ -33,15 +33,6 @@ 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 - } - fn with_cause<F, R>(&mut self, _cause: Cause, f: F) -> R where F: FnOnce(&mut Self) -> R, @@ -532,7 +523,7 @@ pub fn super_relate_consts<R: TypeRelation<'tcx>>( } (ty::ConstKind::Unevaluated(au), ty::ConstKind::Unevaluated(bu)) - if tcx.features().const_evaluatable_checked && !relation.visit_ct_substs() => + if tcx.features().const_evaluatable_checked => { tcx.try_unify_abstract_consts(((au.def, au.substs), (bu.def, bu.substs))) } |
