Skip to content

Commit 77978c6

Browse files
authored
Rollup merge of #122480 - oli-obk:const-eval-span-no-opt, r=RalfJung
Avoid various uses of `Option<Span>` in favor of using `DUMMY_SP` in the few cases that used `None` based on #122471 `DUMMY_SP` is already the sentinel value we have that says "no span". We don't need to wrap these `Span`s in a separate `Option`.
2 parents 38ca6d6 + f63a3f9 commit 77978c6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/machine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,15 +1503,15 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
15031503
fn eval_mir_constant<F>(
15041504
ecx: &InterpCx<'mir, 'tcx, Self>,
15051505
val: mir::Const<'tcx>,
1506-
span: Option<Span>,
1506+
span: Span,
15071507
layout: Option<TyAndLayout<'tcx>>,
15081508
eval: F,
15091509
) -> InterpResult<'tcx, OpTy<'tcx, Self::Provenance>>
15101510
where
15111511
F: Fn(
15121512
&InterpCx<'mir, 'tcx, Self>,
15131513
mir::Const<'tcx>,
1514-
Option<Span>,
1514+
Span,
15151515
Option<TyAndLayout<'tcx>>,
15161516
) -> InterpResult<'tcx, OpTy<'tcx, Self::Provenance>>,
15171517
{

src/shims/intrinsics/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
549549

550550
let index = generic_args[2]
551551
.expect_const()
552-
.eval(*this.tcx, this.param_env(), Some(this.tcx.span))
552+
.eval(*this.tcx, this.param_env(), this.tcx.span)
553553
.unwrap()
554554
.unwrap_branch();
555555
let index_len = index.len();

0 commit comments

Comments
 (0)