Skip to content

Commit 4aabb46

Browse files
committed
Avoid various uses of Option<Span> in favor of using DUMMY_SP in the few cases that used None
1 parent f24f055 commit 4aabb46

File tree

28 files changed

+57
-64
lines changed

28 files changed

+57
-64
lines changed

compiler/rustc_codegen_llvm/src/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
11291129
if name == sym::simd_shuffle_generic {
11301130
let idx = fn_args[2]
11311131
.expect_const()
1132-
.eval(tcx, ty::ParamEnv::reveal_all(), Some(span))
1132+
.eval(tcx, ty::ParamEnv::reveal_all(), span)
11331133
.unwrap()
11341134
.unwrap_branch();
11351135
let n = idx.len() as u64;

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, Mutability}
1919
use rustc_middle::ty::layout::{IntegerExt, TyAndLayout};
2020
use rustc_middle::ty::{self, ExistentialProjection, ParamEnv, Ty, TyCtxt};
2121
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
22+
use rustc_span::DUMMY_SP;
2223
use rustc_target::abi::Integer;
2324
use smallvec::SmallVec;
2425

@@ -704,7 +705,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
704705
// avoiding collisions and will make the emitted type names shorter.
705706
let hash_short = tcx.with_stable_hashing_context(|mut hcx| {
706707
let mut hasher = StableHasher::new();
707-
let ct = ct.eval(tcx, ty::ParamEnv::reveal_all(), None).unwrap();
708+
let ct = ct.eval(tcx, ty::ParamEnv::reveal_all(), DUMMY_SP).unwrap();
708709
hcx.while_hashing_spans(false, |hcx| ct.hash_stable(hcx, &mut hasher));
709710
hasher.finish::<Hash64>()
710711
});

compiler/rustc_codegen_ssa/src/mir/constant.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
2424
// `MirUsedCollector` visited all constants before codegen began, so if we got here there
2525
// can be no more constants that fail to evaluate.
2626
self.monomorphize(constant.const_)
27-
.eval(self.cx.tcx(), ty::ParamEnv::reveal_all(), Some(constant.span))
27+
.eval(self.cx.tcx(), ty::ParamEnv::reveal_all(), constant.span)
2828
.expect("erroneous constant not captured by required_consts")
2929
}
3030

@@ -56,11 +56,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
5656
other => span_bug!(constant.span, "{other:#?}"),
5757
};
5858
let uv = self.monomorphize(uv);
59-
self.cx.tcx().const_eval_resolve_for_typeck(
60-
ty::ParamEnv::reveal_all(),
61-
uv,
62-
Some(constant.span),
63-
)
59+
self.cx.tcx().const_eval_resolve_for_typeck(ty::ParamEnv::reveal_all(), uv, constant.span)
6460
}
6561

6662
/// process constant containing SIMD shuffle indices

compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
130130
| sym::variant_count => {
131131
let value = bx
132132
.tcx()
133-
.const_eval_instance(ty::ParamEnv::reveal_all(), instance, None)
133+
.const_eval_instance(ty::ParamEnv::reveal_all(), instance, span)
134134
.unwrap();
135135
OperandRef::from_const(bx, value, ret_ty).immediate_or_packed_pair(bx)
136136
}

compiler/rustc_const_eval/src/interpret/eval_context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
796796
for &const_ in &body.required_consts {
797797
let c = self
798798
.instantiate_from_current_frame_and_normalize_erasing_regions(const_.const_)?;
799-
c.eval(*self.tcx, self.param_env, Some(const_.span)).map_err(|err| {
799+
c.eval(*self.tcx, self.param_env, const_.span).map_err(|err| {
800800
err.emit_note(*self.tcx);
801801
err
802802
})?;
@@ -1144,7 +1144,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11441144
pub fn eval_mir_constant(
11451145
&self,
11461146
val: &mir::Const<'tcx>,
1147-
span: Option<Span>,
1147+
span: Span,
11481148
layout: Option<TyAndLayout<'tcx>>,
11491149
) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
11501150
M::eval_mir_constant(self, *val, span, layout, |ecx, val, span, layout| {

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
153153
sym::type_name => Ty::new_static_str(self.tcx.tcx),
154154
_ => bug!(),
155155
};
156-
let val = self.ctfe_query(|tcx| {
157-
tcx.const_eval_global_id(self.param_env, gid, Some(tcx.span))
158-
})?;
156+
let val =
157+
self.ctfe_query(|tcx| tcx.const_eval_global_id(self.param_env, gid, tcx.span))?;
159158
let val = self.const_val_to_op(val, ty, Some(dest.layout))?;
160159
self.copy_op(&val, dest)?;
161160
}

compiler/rustc_const_eval/src/interpret/machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,15 +544,15 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
544544
fn eval_mir_constant<F>(
545545
ecx: &InterpCx<'mir, 'tcx, Self>,
546546
val: mir::Const<'tcx>,
547-
span: Option<Span>,
547+
span: Span,
548548
layout: Option<TyAndLayout<'tcx>>,
549549
eval: F,
550550
) -> InterpResult<'tcx, OpTy<'tcx, Self::Provenance>>
551551
where
552552
F: Fn(
553553
&InterpCx<'mir, 'tcx, Self>,
554554
mir::Const<'tcx>,
555-
Option<Span>,
555+
Span,
556556
Option<TyAndLayout<'tcx>>,
557557
) -> InterpResult<'tcx, OpTy<'tcx, Self::Provenance>>,
558558
{

compiler/rustc_const_eval/src/interpret/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
740740
// * During ConstProp, with `TooGeneric` or since the `required_consts` were not all
741741
// checked yet.
742742
// * During CTFE, since promoteds in `const`/`static` initializer bodies can fail.
743-
self.eval_mir_constant(&c, Some(constant.span), layout)?
743+
self.eval_mir_constant(&c, constant.span, layout)?
744744
}
745745
};
746746
trace!("{:?}: {:?}", mir_op, op);

compiler/rustc_hir_typeck/src/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
21692169
len: ty::Const<'tcx>,
21702170
min_len: u64,
21712171
) -> (Option<Ty<'tcx>>, Ty<'tcx>) {
2172-
let len = match len.eval(self.tcx, self.param_env, None) {
2172+
let len = match len.eval(self.tcx, self.param_env, span) {
21732173
Ok(val) => val
21742174
.try_to_scalar()
21752175
.and_then(|scalar| scalar.try_to_int().ok())

compiler/rustc_infer/src/infer/mod.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ impl<'tcx> InferCtxt<'tcx> {
14751475
param_env: ty::ParamEnv<'tcx>,
14761476
unevaluated: ty::UnevaluatedConst<'tcx>,
14771477
ty: Ty<'tcx>,
1478-
span: Option<Span>,
1478+
span: Span,
14791479
) -> Result<ty::Const<'tcx>, ErrorHandled> {
14801480
match self.const_eval_resolve(param_env, unevaluated, span) {
14811481
Ok(Some(val)) => Ok(ty::Const::new_value(self.tcx, val, ty)),
@@ -1509,7 +1509,7 @@ impl<'tcx> InferCtxt<'tcx> {
15091509
&self,
15101510
mut param_env: ty::ParamEnv<'tcx>,
15111511
unevaluated: ty::UnevaluatedConst<'tcx>,
1512-
span: Option<Span>,
1512+
span: Span,
15131513
) -> EvalToValTreeResult<'tcx> {
15141514
let mut args = self.resolve_vars_if_possible(unevaluated.args);
15151515
debug!(?args);
@@ -1521,12 +1521,9 @@ impl<'tcx> InferCtxt<'tcx> {
15211521
if let Some(ct) = tcx.thir_abstract_const(unevaluated.def)? {
15221522
let ct = tcx.expand_abstract_consts(ct.instantiate(tcx, args));
15231523
if let Err(e) = ct.error_reported() {
1524-
return Err(ErrorHandled::Reported(
1525-
e.into(),
1526-
span.unwrap_or(rustc_span::DUMMY_SP),
1527-
));
1524+
return Err(ErrorHandled::Reported(e.into(), span));
15281525
} else if ct.has_non_region_infer() || ct.has_non_region_param() {
1529-
return Err(ErrorHandled::TooGeneric(span.unwrap_or(rustc_span::DUMMY_SP)));
1526+
return Err(ErrorHandled::TooGeneric(span));
15301527
} else {
15311528
args = replace_param_and_infer_args_with_placeholder(tcx, args);
15321529
}

compiler/rustc_middle/src/mir/consts.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt::{self, Debug, Display, Formatter};
22

33
use rustc_hir::def_id::DefId;
44
use rustc_session::RemapFileNameExt;
5-
use rustc_span::Span;
5+
use rustc_span::{Span, DUMMY_SP};
66
use rustc_target::abi::{HasDataLayout, Size};
77

88
use crate::mir::interpret::{alloc_range, AllocId, ConstAllocation, ErrorHandled, Scalar};
@@ -273,7 +273,7 @@ impl<'tcx> Const<'tcx> {
273273
self,
274274
tcx: TyCtxt<'tcx>,
275275
param_env: ty::ParamEnv<'tcx>,
276-
span: Option<Span>,
276+
span: Span,
277277
) -> Result<ConstValue<'tcx>, ErrorHandled> {
278278
match self {
279279
Const::Ty(c) => {
@@ -293,7 +293,7 @@ impl<'tcx> Const<'tcx> {
293293
/// Normalizes the constant to a value or an error if possible.
294294
#[inline]
295295
pub fn normalize(self, tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>) -> Self {
296-
match self.eval(tcx, param_env, None) {
296+
match self.eval(tcx, param_env, DUMMY_SP) {
297297
Ok(val) => Self::Val(val, self.ty()),
298298
Err(ErrorHandled::Reported(guar, _span)) => {
299299
Self::Ty(ty::Const::new_error(tcx, guar.into(), self.ty()))
@@ -313,10 +313,10 @@ impl<'tcx> Const<'tcx> {
313313
// Avoid the `valtree_to_const_val` query. Can only be done on primitive types that
314314
// are valtree leaves, and *not* on references. (References should return the
315315
// pointer here, which valtrees don't represent.)
316-
let val = c.eval(tcx, param_env, None).ok()?;
316+
let val = c.eval(tcx, param_env, DUMMY_SP).ok()?;
317317
Some(val.unwrap_leaf().into())
318318
}
319-
_ => self.eval(tcx, param_env, None).ok()?.try_to_scalar(),
319+
_ => self.eval(tcx, param_env, DUMMY_SP).ok()?.try_to_scalar(),
320320
}
321321
}
322322

compiler/rustc_middle/src/mir/interpret/queries.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl<'tcx> TyCtxt<'tcx> {
2424
let instance = ty::Instance::new(def_id, args);
2525
let cid = GlobalId { instance, promoted: None };
2626
let param_env = self.param_env(def_id).with_reveal_all_normalized(self);
27-
self.const_eval_global_id(param_env, cid, None)
27+
self.const_eval_global_id(param_env, cid, DUMMY_SP)
2828
}
2929
/// Resolves and evaluates a constant.
3030
///
@@ -40,7 +40,7 @@ impl<'tcx> TyCtxt<'tcx> {
4040
self,
4141
param_env: ty::ParamEnv<'tcx>,
4242
ct: mir::UnevaluatedConst<'tcx>,
43-
span: Option<Span>,
43+
span: Span,
4444
) -> EvalToConstValueResult<'tcx> {
4545
// Cannot resolve `Unevaluated` constants that contain inference
4646
// variables. We reject those here since `resolve`
@@ -73,7 +73,7 @@ impl<'tcx> TyCtxt<'tcx> {
7373
self,
7474
param_env: ty::ParamEnv<'tcx>,
7575
ct: ty::UnevaluatedConst<'tcx>,
76-
span: Option<Span>,
76+
span: Span,
7777
) -> EvalToValTreeResult<'tcx> {
7878
// Cannot resolve `Unevaluated` constants that contain inference
7979
// variables. We reject those here since `resolve`
@@ -130,7 +130,7 @@ impl<'tcx> TyCtxt<'tcx> {
130130
self,
131131
param_env: ty::ParamEnv<'tcx>,
132132
instance: ty::Instance<'tcx>,
133-
span: Option<Span>,
133+
span: Span,
134134
) -> EvalToConstValueResult<'tcx> {
135135
self.const_eval_global_id(param_env, GlobalId { instance, promoted: None }, span)
136136
}
@@ -141,12 +141,12 @@ impl<'tcx> TyCtxt<'tcx> {
141141
self,
142142
param_env: ty::ParamEnv<'tcx>,
143143
cid: GlobalId<'tcx>,
144-
span: Option<Span>,
144+
span: Span,
145145
) -> EvalToConstValueResult<'tcx> {
146146
// Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
147147
// improve caching of queries.
148148
let inputs = self.erase_regions(param_env.with_reveal_all_normalized(self).and(cid));
149-
if let Some(span) = span {
149+
if !span.is_dummy() {
150150
// The query doesn't know where it is being invoked, so we need to fix the span.
151151
self.at(span).eval_to_const_value_raw(inputs).map_err(|e| e.with_span(span))
152152
} else {
@@ -160,13 +160,13 @@ impl<'tcx> TyCtxt<'tcx> {
160160
self,
161161
param_env: ty::ParamEnv<'tcx>,
162162
cid: GlobalId<'tcx>,
163-
span: Option<Span>,
163+
span: Span,
164164
) -> EvalToValTreeResult<'tcx> {
165165
// Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
166166
// improve caching of queries.
167167
let inputs = self.erase_regions(param_env.with_reveal_all_normalized(self).and(cid));
168168
debug!(?inputs);
169-
if let Some(span) = span {
169+
if !span.is_dummy() {
170170
// The query doesn't know where it is being invoked, so we need to fix the span.
171171
self.at(span).eval_to_valtree(inputs).map_err(|e| e.with_span(span))
172172
} else {

compiler/rustc_middle/src/ty/consts.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl<'tcx> Const<'tcx> {
335335
self,
336336
tcx: TyCtxt<'tcx>,
337337
param_env: ParamEnv<'tcx>,
338-
span: Option<Span>,
338+
span: Span,
339339
) -> Result<ValTree<'tcx>, ErrorHandled> {
340340
assert!(!self.has_escaping_bound_vars(), "escaping vars in {self:?}");
341341
match self.kind() {
@@ -349,7 +349,7 @@ impl<'tcx> Const<'tcx> {
349349
else {
350350
// This can happen when we run on ill-typed code.
351351
let e = tcx.dcx().span_delayed_bug(
352-
span.unwrap_or(DUMMY_SP),
352+
span,
353353
"`ty::Const::eval` called on a non-valtree-compatible type",
354354
);
355355
return Err(e.into());
@@ -362,14 +362,14 @@ impl<'tcx> Const<'tcx> {
362362
| ConstKind::Infer(_)
363363
| ConstKind::Bound(_, _)
364364
| ConstKind::Placeholder(_)
365-
| ConstKind::Expr(_) => Err(ErrorHandled::TooGeneric(span.unwrap_or(DUMMY_SP))),
365+
| ConstKind::Expr(_) => Err(ErrorHandled::TooGeneric(span)),
366366
}
367367
}
368368

369369
/// Normalizes the constant to a value or an error if possible.
370370
#[inline]
371371
pub fn normalize(self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> Self {
372-
match self.eval(tcx, param_env, None) {
372+
match self.eval(tcx, param_env, DUMMY_SP) {
373373
Ok(val) => Self::new_value(tcx, val, self.ty()),
374374
Err(ErrorHandled::Reported(r, _span)) => Self::new_error(tcx, r.into(), self.ty()),
375375
Err(ErrorHandled::TooGeneric(_span)) => self,
@@ -382,7 +382,7 @@ impl<'tcx> Const<'tcx> {
382382
tcx: TyCtxt<'tcx>,
383383
param_env: ty::ParamEnv<'tcx>,
384384
) -> Option<Scalar> {
385-
self.eval(tcx, param_env, None).ok()?.try_to_scalar()
385+
self.eval(tcx, param_env, DUMMY_SP).ok()?.try_to_scalar()
386386
}
387387

388388
#[inline]

compiler/rustc_mir_build/src/thir/pattern/mod.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,12 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
524524
// Prefer valtrees over opaque constants.
525525
let const_value = self
526526
.tcx
527-
.const_eval_global_id_for_typeck(param_env_reveal_all, cid, Some(span))
527+
.const_eval_global_id_for_typeck(param_env_reveal_all, cid, span)
528528
.map(|val| match val {
529529
Some(valtree) => mir::Const::Ty(ty::Const::new_value(self.tcx, valtree, ty)),
530530
None => mir::Const::Val(
531531
self.tcx
532-
.const_eval_global_id(param_env_reveal_all, cid, Some(span))
532+
.const_eval_global_id(param_env_reveal_all, cid, span)
533533
.expect("const_eval_global_id_for_typeck should have already failed"),
534534
ty,
535535
),
@@ -627,15 +627,14 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
627627
// First try using a valtree in order to destructure the constant into a pattern.
628628
// FIXME: replace "try to do a thing, then fall back to another thing"
629629
// but something more principled, like a trait query checking whether this can be turned into a valtree.
630-
if let Ok(Some(valtree)) =
631-
self.tcx.const_eval_resolve_for_typeck(self.param_env, ct, Some(span))
630+
if let Ok(Some(valtree)) = self.tcx.const_eval_resolve_for_typeck(self.param_env, ct, span)
632631
{
633632
let subpattern =
634633
self.const_to_pat(Const::Ty(ty::Const::new_value(self.tcx, valtree, ty)), id, span);
635634
PatKind::InlineConstant { subpattern, def: def_id }
636635
} else {
637636
// If that fails, convert it to an opaque constant pattern.
638-
match tcx.const_eval_resolve(self.param_env, uneval, Some(span)) {
637+
match tcx.const_eval_resolve(self.param_env, uneval, span) {
639638
Ok(val) => self.const_to_pat(mir::Const::Val(val, ty), id, span).kind,
640639
Err(ErrorHandled::TooGeneric(_)) => {
641640
// If we land here it means the const can't be evaluated because it's `TooGeneric`.

compiler/rustc_mir_transform/src/dataflow_const_prop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ impl<'a, 'tcx> ConstAnalysis<'a, 'tcx> {
394394
}
395395
Operand::Constant(box constant) => {
396396
if let Ok(constant) =
397-
self.ecx.eval_mir_constant(&constant.const_, Some(constant.span), None)
397+
self.ecx.eval_mir_constant(&constant.const_, constant.span, None)
398398
{
399399
self.assign_constant(state, place, constant, &[]);
400400
}

compiler/rustc_mir_transform/src/gvn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
367367
Repeat(..) => return None,
368368

369369
Constant { ref value, disambiguator: _ } => {
370-
self.ecx.eval_mir_constant(value, None, None).ok()?
370+
self.ecx.eval_mir_constant(value, DUMMY_SP, None).ok()?
371371
}
372372
Aggregate(kind, variant, ref fields) => {
373373
let fields = fields

compiler/rustc_mir_transform/src/jump_threading.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<'tcx, 'a> TOFinder<'tcx, 'a> {
417417
// If we expect `lhs ?= A`, we have an opportunity if we assume `constant == A`.
418418
Operand::Constant(constant) => {
419419
let constant =
420-
self.ecx.eval_mir_constant(&constant.const_, Some(constant.span), None).ok()?;
420+
self.ecx.eval_mir_constant(&constant.const_, constant.span, None).ok()?;
421421
self.process_constant(bb, lhs, constant, state);
422422
}
423423
// Transfer the conditions on the copied rhs.

compiler/rustc_mir_transform/src/known_panics_lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
261261
// manually normalized.
262262
let val = self.tcx.try_normalize_erasing_regions(self.param_env, c.const_).ok()?;
263263

264-
self.use_ecx(|this| this.ecx.eval_mir_constant(&val, Some(c.span), None))?
264+
self.use_ecx(|this| this.ecx.eval_mir_constant(&val, c.span, None))?
265265
.as_mplace_or_imm()
266266
.right()
267267
}

compiler/rustc_monomorphize/src/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
825825
fn visit_constant(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) {
826826
let const_ = self.monomorphize(constant.const_);
827827
let param_env = ty::ParamEnv::reveal_all();
828-
let val = match const_.eval(self.tcx, param_env, Some(constant.span)) {
828+
let val = match const_.eval(self.tcx, param_env, constant.span) {
829829
Ok(v) => v,
830830
Err(ErrorHandled::TooGeneric(..)) => span_bug!(
831831
self.body.source_info(location).span,

compiler/rustc_smir/src/rustc_smir/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
5656

5757
fn visit_constant(&mut self, constant: &mut mir::ConstOperand<'tcx>, location: mir::Location) {
5858
let const_ = self.monomorphize(constant.const_);
59-
let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), Some(constant.span)) {
59+
let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), constant.span) {
6060
Ok(v) => v,
6161
Err(mir::interpret::ErrorHandled::Reported(..)) => return,
6262
Err(mir::interpret::ErrorHandled::TooGeneric(..)) => {

0 commit comments

Comments
 (0)