@@ -24,11 +24,13 @@ use super::{
2424
2525#[ derive( Debug , PartialEq , Copy , Clone ) ]
2626pub enum MemoryKind < T > {
27- /// Error if deallocated except during a stack pop
27+ /// Stack memory. Error if deallocated except during a stack pop.
2828 Stack ,
29- /// Error if ever deallocated
29+ /// Memory backing vtables. Error if ever deallocated.
3030 Vtable ,
31- /// Additional memory kinds a machine wishes to distinguish from the builtin ones
31+ /// Memory allocated by `caller_location` intrinsic. Error if ever deallocated.
32+ CallerLocation ,
33+ /// Additional memory kinds a machine wishes to distinguish from the builtin ones.
3234 Machine ( T ) ,
3335}
3436
@@ -38,6 +40,7 @@ impl<T: MayLeak> MayLeak for MemoryKind<T> {
3840 match self {
3941 MemoryKind :: Stack => false ,
4042 MemoryKind :: Vtable => true ,
43+ MemoryKind :: CallerLocation => true ,
4144 MemoryKind :: Machine ( k) => k. may_leak ( )
4245 }
4346 }
@@ -719,6 +722,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
719722 let extra = match kind {
720723 MemoryKind :: Stack => " (stack)" . to_owned ( ) ,
721724 MemoryKind :: Vtable => " (vtable)" . to_owned ( ) ,
725+ MemoryKind :: CallerLocation => " (caller_location)" . to_owned ( ) ,
722726 MemoryKind :: Machine ( m) => format ! ( " ({:?})" , m) ,
723727 } ;
724728 self . dump_alloc_helper (
0 commit comments