replace another Option<Span> by DUMMY_SP
This commit is contained in:
parent
60a7c191c6
commit
1d87efc1da
2 changed files with 10 additions and 10 deletions
|
@ -7,7 +7,7 @@ use rustc_middle::mir::AssertKind;
|
|||
use rustc_middle::query::TyCtxtAt;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_middle::ty::{layout::LayoutError, ConstInt};
|
||||
use rustc_span::{Span, Symbol, DUMMY_SP};
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
use super::CompileTimeInterpreter;
|
||||
use crate::errors::{self, FrameNote, ReportErrorExt};
|
||||
|
@ -121,7 +121,7 @@ where
|
|||
pub(super) fn report<'tcx, C, F, E>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
error: InterpError<'tcx>,
|
||||
span: Option<Span>,
|
||||
span: Span,
|
||||
get_span_and_frames: C,
|
||||
mk: F,
|
||||
) -> ErrorHandled
|
||||
|
@ -135,16 +135,16 @@ where
|
|||
// Don't emit a new diagnostic for these errors, they are already reported elsewhere or
|
||||
// should remain silent.
|
||||
err_inval!(Layout(LayoutError::Unknown(_))) | err_inval!(TooGeneric) => {
|
||||
ErrorHandled::TooGeneric(span.unwrap_or(DUMMY_SP))
|
||||
ErrorHandled::TooGeneric(span)
|
||||
}
|
||||
err_inval!(AlreadyReported(guar)) => ErrorHandled::Reported(guar, span.unwrap_or(DUMMY_SP)),
|
||||
err_inval!(AlreadyReported(guar)) => ErrorHandled::Reported(guar, span),
|
||||
err_inval!(Layout(LayoutError::ReferencesError(guar))) => {
|
||||
ErrorHandled::Reported(guar.into(), span.unwrap_or(DUMMY_SP))
|
||||
ErrorHandled::Reported(guar.into(), span)
|
||||
}
|
||||
// Report remaining errors.
|
||||
_ => {
|
||||
let (our_span, frames) = get_span_and_frames();
|
||||
let span = span.unwrap_or(our_span);
|
||||
let span = span.substitute_dummy(our_span);
|
||||
let err = mk(span, frames);
|
||||
let mut err = tcx.dcx().create_err(err);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue