diff options
| author | bors <bors@rust-lang.org> | 2022-09-08 10:30:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-08 10:30:00 +0000 |
| commit | ccb5595df2ed412eda6444edc7eaf06f709fa79d (patch) | |
| tree | 8f36aaed3f0d5aec36c2a8ee8de0818b9b8f9c6d /compiler/rustc_middle | |
| parent | b42244c2ab462a5ac4c901e8988f9fcb78776d9c (diff) | |
| parent | e6660326a31d4fcd0031562d83d9fd648fb28e56 (diff) | |
| download | rust-ccb5595df2ed412eda6444edc7eaf06f709fa79d.tar.gz rust-ccb5595df2ed412eda6444edc7eaf06f709fa79d.zip | |
Auto merge of #98900 - lcnr:region-stuff, r=jackh726
const_generics: correctly deal with bound variables removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables. Each commit should be fairly self-contained, even if they build on each other r? `@jackh726`
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/ty/consts/kind.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/relate.rs | 4 |
2 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/consts/kind.rs b/compiler/rustc_middle/src/ty/consts/kind.rs index 3840e79cebd..ff20da65c01 100644 --- a/compiler/rustc_middle/src/ty/consts/kind.rs +++ b/compiler/rustc_middle/src/ty/consts/kind.rs @@ -180,6 +180,7 @@ impl<'tcx> ConstKind<'tcx> { param_env: ParamEnv<'tcx>, eval_mode: EvalMode, ) -> Option<Result<EvalResult<'tcx>, ErrorGuaranteed>> { + assert!(!self.has_escaping_bound_vars(), "escaping vars in {self:?}"); if let ConstKind::Unevaluated(unevaluated) = self { use crate::mir::interpret::ErrorHandled; diff --git a/compiler/rustc_middle/src/ty/relate.rs b/compiler/rustc_middle/src/ty/relate.rs index 109a4df83b0..81476195d29 100644 --- a/compiler/rustc_middle/src/ty/relate.rs +++ b/compiler/rustc_middle/src/ty/relate.rs @@ -594,10 +594,6 @@ pub fn super_relate_consts<'tcx, R: TypeRelation<'tcx>>( ); } - let eagerly_eval = |x: ty::Const<'tcx>| x.eval(tcx, relation.param_env()); - let a = eagerly_eval(a); - let b = eagerly_eval(b); - // Currently, the values that can be unified are primitive types, // and those that derive both `PartialEq` and `Eq`, corresponding // to structural-match types. |
