summaryrefslogtreecommitdiff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-03-11 18:00:08 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-05-13 10:12:15 +0000
commit7de9aac4fbe87f98903ce332e8e2c99d18a414da (patch)
tree41a2eefebe0b91e9356361c4037285d0b5a19e6e /compiler/rustc_middle/src
parent2ec007191348ef7cc13eb55e44e007b02cf75cf3 (diff)
downloadrust-7de9aac4fbe87f98903ce332e8e2c99d18a414da.tar.gz
Support ConstantIndex in debuginfo.
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 6e8e68b616b..6b0401a4c9b 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -1554,8 +1554,11 @@ impl<V, T> ProjectionElem<V, T> {
/// Returns `true` if this is accepted inside `VarDebugInfoContents::Place`.
pub fn can_use_in_debuginfo(&self) -> bool {
match self {
- Self::Deref | Self::Downcast(_, _) | Self::Field(_, _) => true,
- Self::ConstantIndex { .. }
+ Self::ConstantIndex { from_end: false, .. }
+ | Self::Deref
+ | Self::Downcast(_, _)
+ | Self::Field(_, _) => true,
+ Self::ConstantIndex { from_end: true, .. }
| Self::Index(_)
| Self::OpaqueCast(_)
| Self::Subslice { .. } => false,