about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-06-04 15:29:51 -0400
committerRalf Jung <post@ralfj.de>2022-06-04 15:59:24 -0400
commit9ab4f876a1c5321fe451bf691eb28d87dbf5ff84 (patch)
treec93f6c07ee3c2e8ec13d2c5ca6704cf423ce99e8 /compiler/rustc_const_eval
parent7892e1cedb0b1fe8d924516425481654b89ba834 (diff)
downloadrust-9ab4f876a1c5321fe451bf691eb28d87dbf5ff84.tar.gz
rust-9ab4f876a1c5321fe451bf691eb28d87dbf5ff84.zip
const_prop_lint: ensure we have up-to-date cur_span()
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/interpret/eval_context.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs
index 0c954ac6e5f..a82ddfb5ac5 100644
--- a/compiler/rustc_const_eval/src/interpret/eval_context.rs
+++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs
@@ -126,7 +126,9 @@ pub struct Frame<'mir, 'tcx, Tag: Provenance = AllocId, Extra = ()> {
     /// this frame (can happen e.g. during frame initialization, and during unwinding on
     /// frames without cleanup code).
     /// We basically abuse `Result` as `Either`.
-    pub(super) loc: Result<mir::Location, Span>,
+    ///
+    /// Needs to be public because ConstProp does unspeakable things to it.
+    pub loc: Result<mir::Location, Span>,
 }
 
 /// What we store about a frame in an interpreter backtrace.
@@ -320,6 +322,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> LayoutOfHelpers<'tcx> for InterpC
 
     #[inline]
     fn layout_tcx_at_span(&self) -> Span {
+        // Using the cheap root span for performance.
         self.tcx.span
     }