diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-09-06 18:41:01 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-03-09 17:45:13 +0000 |
| commit | 4462bb54e3bbff7eecae1816836f306fcc309e05 (patch) | |
| tree | aac24138a84068a1ca3a60247704bbcddc241bd4 /compiler/rustc_const_eval/src/transform | |
| parent | be758ef5ab570b7685c9a5eecacab65911da9e6f (diff) | |
| download | rust-4462bb54e3bbff7eecae1816836f306fcc309e05.tar.gz rust-4462bb54e3bbff7eecae1816836f306fcc309e05.zip | |
Introduce a no-op PlaceMention statement for `let _ =`.
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/check_consts/check.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/validate.rs | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index 656baa784d7..081d9dc8700 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -690,6 +690,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { | StatementKind::StorageLive(_) | StatementKind::StorageDead(_) | StatementKind::Retag { .. } + | StatementKind::PlaceMention(..) | StatementKind::AscribeUserType(..) | StatementKind::Coverage(..) | StatementKind::Intrinsic(..) diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs index 8ecd8f639dd..49b1e6d967c 100644 --- a/compiler/rustc_const_eval/src/transform/validate.rs +++ b/compiler/rustc_const_eval/src/transform/validate.rs @@ -679,6 +679,14 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { } } } + StatementKind::PlaceMention(..) => { + if self.mir_phase >= MirPhase::Runtime(RuntimePhase::Initial) { + self.fail( + location, + "`PlaceMention` should have been removed after drop lowering phase", + ); + } + } StatementKind::AscribeUserType(..) => { if self.mir_phase >= MirPhase::Runtime(RuntimePhase::Initial) { self.fail( |
