about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/interpret
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-03-16 12:57:31 -0400
committerJoshua Nelson <jyn514@gmail.com>2021-03-27 22:16:34 -0400
commitde0fda9558e5b9eed94cd1e2c1599ea72115d744 (patch)
tree942ff681716427b047195805b3e7c578a5d012be /compiler/rustc_mir/src/interpret
parent441dc3640a408e612064464b0c6308bdca6c16ce (diff)
downloadrust-de0fda9558e5b9eed94cd1e2c1599ea72115d744.tar.gz
rust-de0fda9558e5b9eed94cd1e2c1599ea72115d744.zip
Address review comments
- Add back `HirIdVec`, with a comment that it will soon be used.
- Add back `*_region` functions, with a comment they may soon be used.
- Remove `-Z borrowck_stats` completely. It didn't do anything.
- Remove `make_nop` completely.
- Add back `current_loc`, which is used by an out-of-tree tool.
- Fix style nits
- Remove `AtomicCell` with `cfg(parallel_compiler)` for consistency.
Diffstat (limited to 'compiler/rustc_mir/src/interpret')
-rw-r--r--compiler/rustc_mir/src/interpret/eval_context.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_mir/src/interpret/eval_context.rs b/compiler/rustc_mir/src/interpret/eval_context.rs
index 3f20a83fc25..18d4d71e517 100644
--- a/compiler/rustc_mir/src/interpret/eval_context.rs
+++ b/compiler/rustc_mir/src/interpret/eval_context.rs
@@ -226,6 +226,18 @@ impl<'mir, 'tcx, Tag> Frame<'mir, 'tcx, Tag> {
 }
 
 impl<'mir, 'tcx, Tag, Extra> Frame<'mir, 'tcx, Tag, Extra> {
+    /// Get the current location within the Frame.
+    ///
+    /// If this is `Err`, we are not currently executing any particular statement in
+    /// this frame (can happen e.g. during frame initialization, and during unwinding on
+    /// frames without cleanup code).
+    /// We basically abuse `Result` as `Either`.
+    ///
+    /// Used by priroda.
+    pub fn current_loc(&self) -> Result<mir::Location, Span> {
+        self.loc
+    }
+
     /// Return the `SourceInfo` of the current instruction.
     pub fn current_source_info(&self) -> Option<&mir::SourceInfo> {
         self.loc.ok().map(|loc| self.body.source_info(loc))