diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-04-04 10:39:26 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-04-04 10:39:26 +0000 |
| commit | b5d96d5ec5388b89c700b4b9e6f7f73afa9cbcb1 (patch) | |
| tree | 4cc8c9c0da32c8d8930584f0e69a8994c52f6253 /compiler/rustc_const_eval/src | |
| parent | 35d06f9c747bc791d7d6902248d851da98616a57 (diff) | |
| download | rust-b5d96d5ec5388b89c700b4b9e6f7f73afa9cbcb1.tar.gz rust-b5d96d5ec5388b89c700b4b9e6f7f73afa9cbcb1.zip | |
Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/operand.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index 8d5192bca67..5310ef0bb3e 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -612,14 +612,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { span: Option<Span>, layout: Option<TyAndLayout<'tcx>>, ) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> { - // FIXME(const_prop): normalization needed b/c const prop lint in - // `mir_drops_elaborated_and_const_checked`, which happens before - // optimized MIR. Only after optimizing the MIR can we guarantee - // that the `RevealAll` pass has happened and that the body's consts - // are normalized, so any call to resolve before that needs to be - // manually normalized. - let val = self.tcx.normalize_erasing_regions(self.param_env, *val); - match val { + match *val { mir::ConstantKind::Ty(ct) => { let ty = ct.ty(); let valtree = self.eval_ty_constant(ct, span)?; |
