@@ -2,6 +2,7 @@ use std::mem;
2
2
3
3
use rustc_errors:: { DiagArgName , DiagArgValue , DiagMessage , IntoDiagnostic , IntoDiagnosticArg } ;
4
4
use rustc_hir:: CRATE_HIR_ID ;
5
+ use rustc_middle:: mir:: interpret:: Provenance ;
5
6
use rustc_middle:: mir:: AssertKind ;
6
7
use rustc_middle:: query:: TyCtxtAt ;
7
8
use rustc_middle:: ty:: TyCtxt ;
@@ -58,12 +59,12 @@ impl<'tcx> Into<InterpErrorInfo<'tcx>> for ConstEvalErrKind {
58
59
59
60
pub fn get_span_and_frames < ' tcx , ' mir > (
60
61
tcx : TyCtxtAt < ' tcx > ,
61
- machine : & CompileTimeInterpreter < ' mir , ' tcx > ,
62
+ stack : & [ Frame < ' mir , ' tcx , impl Provenance , impl Sized > ] ,
62
63
) -> ( Span , Vec < errors:: FrameNote > )
63
64
where
64
65
' tcx : ' mir ,
65
66
{
66
- let mut stacktrace = Frame :: generate_stacktrace_from_stack ( & machine . stack ) ;
67
+ let mut stacktrace = Frame :: generate_stacktrace_from_stack ( stack) ;
67
68
// Filter out `requires_caller_location` frames.
68
69
stacktrace. retain ( |frame| !frame. instance . def . requires_caller_location ( * tcx) ) ;
69
70
let span = stacktrace. first ( ) . map ( |f| f. span ) . unwrap_or ( tcx. span ) ;
@@ -167,7 +168,7 @@ pub(super) fn lint<'tcx, 'mir, L>(
167
168
) where
168
169
L : for < ' a > rustc_errors:: DecorateLint < ' a , ( ) > ,
169
170
{
170
- let ( span, frames) = get_span_and_frames ( tcx, machine) ;
171
+ let ( span, frames) = get_span_and_frames ( tcx, & machine. stack ) ;
171
172
172
173
tcx. emit_node_span_lint (
173
174
lint,
0 commit comments