about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-07-06 11:27:54 -0400
committerRalf Jung <post@ralfj.de>2022-07-06 11:27:54 -0400
commitdfd243e27c5f3e169511cf300b61928ecd31db5c (patch)
tree4a8b082f2200ef067c5472c04a350ff899e0f536 /compiler/rustc_const_eval/src/interpret
parent5b8cf49c51833ee5d27ae2e8e179337dbb9f14d7 (diff)
downloadrust-dfd243e27c5f3e169511cf300b61928ecd31db5c.tar.gz
rust-dfd243e27c5f3e169511cf300b61928ecd31db5c.zip
add track_caller to some interpreter functions
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/operand.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs
index d48f6521ba2..47d128307d3 100644
--- a/compiler/rustc_const_eval/src/interpret/operand.rs
+++ b/compiler/rustc_const_eval/src/interpret/operand.rs
@@ -71,6 +71,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
     }
 
     #[inline]
+    #[track_caller]
     pub fn to_scalar_or_uninit(self) -> ScalarMaybeUninit<Tag> {
         match self {
             Immediate::Scalar(val) => val,
@@ -79,11 +80,13 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
     }
 
     #[inline]
+    #[track_caller]
     pub fn to_scalar(self) -> InterpResult<'tcx, Scalar<Tag>> {
         self.to_scalar_or_uninit().check_init()
     }
 
     #[inline]
+    #[track_caller]
     pub fn to_scalar_or_uninit_pair(self) -> (ScalarMaybeUninit<Tag>, ScalarMaybeUninit<Tag>) {
         match self {
             Immediate::ScalarPair(val1, val2) => (val1, val2),
@@ -92,6 +95,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
     }
 
     #[inline]
+    #[track_caller]
     pub fn to_scalar_pair(self) -> InterpResult<'tcx, (Scalar<Tag>, Scalar<Tag>)> {
         let (val1, val2) = self.to_scalar_or_uninit_pair();
         Ok((val1.check_init()?, val2.check_init()?))