@@ -11,8 +11,8 @@ use rustc_span::{Span, Symbol};
1111use super :: CompileTimeMachine ;
1212use crate :: errors:: { self , FrameNote , ReportErrorExt } ;
1313use 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,
1616} ;
1717
1818/// The CTFE machine has some custom error kinds.
@@ -32,12 +32,12 @@ pub enum ConstEvalErrKind {
3232 /// Called `const_make_global` twice.
3333 ConstMakeGlobalPtrAlreadyMadeGlobal ( AllocId ) ,
3434 /// Called `const_make_global` on a non-heap pointer.
35- ConstMakeGlobalPtrIsNonHeap ( String ) ,
35+ ConstMakeGlobalPtrIsNonHeap ( Pointer < Option < CtfeProvenance > > ) ,
3636 /// Called `const_make_global` on a dangling pointer.
37- ConstMakeGlobalWithDanglingPtr ( String ) ,
37+ ConstMakeGlobalWithDanglingPtr ( Pointer < Option < CtfeProvenance > > ) ,
3838 /// Called `const_make_global` on a pointer that does not start at the
3939 /// beginning of an object.
40- ConstMakeGlobalWithOffset ( String ) ,
40+ ConstMakeGlobalWithOffset ( Pointer < Option < CtfeProvenance > > ) ,
4141}
4242
4343impl MachineStopType for ConstEvalErrKind {
@@ -74,7 +74,7 @@ impl MachineStopType for ConstEvalErrKind {
7474 ConstMakeGlobalPtrIsNonHeap ( ptr)
7575 | ConstMakeGlobalWithOffset ( ptr)
7676 | ConstMakeGlobalWithDanglingPtr ( ptr) => {
77- adder ( "ptr" . into ( ) , ptr. into_diag_arg ( & mut None ) ) ;
77+ adder ( "ptr" . into ( ) , format ! ( "{ ptr:?}" ) . into_diag_arg ( & mut None ) ) ;
7878 }
7979 ConstMakeGlobalPtrAlreadyMadeGlobal ( alloc) => {
8080 adder ( "alloc" . into ( ) , alloc. into_diag_arg ( & mut None ) ) ;
0 commit comments