replace another Option<Span> by DUMMY_SP

This commit is contained in:
Ralf Jung
2024-05-07 14:52:42 +02:00
parent 60a7c191c6
commit 1d87efc1da
2 changed files with 10 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_session::lint;
use rustc_span::def_id::LocalDefId;
use rustc_span::Span;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::{self, Abi};
use super::{CanAccessMutGlobal, CompileTimeEvalContext, CompileTimeInterpreter};
@@ -298,7 +298,7 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
super::report(
tcx,
error.into_kind(),
Some(span),
span,
|| (span, vec![]),
|span, _| errors::NullaryIntrinsicError { span },
)
@@ -406,7 +406,7 @@ fn eval_in_interpreter<'tcx, R: InterpretationResult<'tcx>>(
super::report(
*ecx.tcx,
error,
None,
DUMMY_SP,
|| super::get_span_and_frames(ecx.tcx, ecx.stack()),
|span, frames| ConstEvalError { span, error_kind: kind, instance, frame_notes: frames },
)
@@ -461,7 +461,7 @@ fn report_validation_error<'mir, 'tcx>(
crate::const_eval::report(
*ecx.tcx,
error,
None,
DUMMY_SP,
|| crate::const_eval::get_span_and_frames(ecx.tcx, ecx.stack()),
move |span, frames| errors::ValidationFailure { span, ub_note, frames, raw_bytes },
)