@@ -11,8 +11,8 @@ use rustc_span::{Span, Symbol};
11
11
use super :: CompileTimeMachine ;
12
12
use crate :: errors:: { self , FrameNote , ReportErrorExt } ;
13
13
use crate :: interpret:: {
14
- ErrorHandled , Frame , InterpErrorInfo , InterpErrorKind , MachineStopType , err_inval ,
15
- err_machine_stop,
14
+ CtfeProvenance , ErrorHandled , Frame , InterpErrorInfo , InterpErrorKind , MachineStopType ,
15
+ Pointer , err_inval , err_machine_stop,
16
16
} ;
17
17
18
18
/// The CTFE machine has some custom error kinds.
@@ -32,12 +32,12 @@ pub enum ConstEvalErrKind {
32
32
/// Called `const_make_global` twice.
33
33
ConstMakeGlobalPtrAlreadyMadeGlobal ( AllocId ) ,
34
34
/// Called `const_make_global` on a non-heap pointer.
35
- ConstMakeGlobalPtrIsNonHeap ( String ) ,
35
+ ConstMakeGlobalPtrIsNonHeap ( Pointer < Option < CtfeProvenance > > ) ,
36
36
/// Called `const_make_global` on a dangling pointer.
37
- ConstMakeGlobalWithDanglingPtr ( String ) ,
37
+ ConstMakeGlobalWithDanglingPtr ( Pointer < Option < CtfeProvenance > > ) ,
38
38
/// Called `const_make_global` on a pointer that does not start at the
39
39
/// beginning of an object.
40
- ConstMakeGlobalWithOffset ( String ) ,
40
+ ConstMakeGlobalWithOffset ( Pointer < Option < CtfeProvenance > > ) ,
41
41
}
42
42
43
43
impl MachineStopType for ConstEvalErrKind {
@@ -74,7 +74,7 @@ impl MachineStopType for ConstEvalErrKind {
74
74
ConstMakeGlobalPtrIsNonHeap ( ptr)
75
75
| ConstMakeGlobalWithOffset ( ptr)
76
76
| ConstMakeGlobalWithDanglingPtr ( ptr) => {
77
- adder ( "ptr" . into ( ) , ptr. into_diag_arg ( & mut None ) ) ;
77
+ adder ( "ptr" . into ( ) , format ! ( "{ ptr:?}" ) . into_diag_arg ( & mut None ) ) ;
78
78
}
79
79
ConstMakeGlobalPtrAlreadyMadeGlobal ( alloc) => {
80
80
adder ( "alloc" . into ( ) , alloc. into_diag_arg ( & mut None ) ) ;
0 commit comments