Skip to content

Commit eeca87b

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

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
7474
let cv = fx.monomorphize(constant.const_);
7575
// This cannot fail because we checked all required_consts in advance.
7676
let val = cv
77-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
77+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), constant.span)
7878
.expect("erroneous constant missed by mono item collection");
7979
(val, cv.ty())
8080
}

src/intrinsics/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
728728
| sym::variant_count => {
729729
intrinsic_args!(fx, args => (); intrinsic);
730730

731-
let const_val =
732-
fx.tcx.const_eval_instance(ParamEnv::reveal_all(), instance, None).unwrap();
731+
let const_val = fx
732+
.tcx
733+
.const_eval_instance(ParamEnv::reveal_all(), instance, source_info.span)
734+
.unwrap();
733735
let val = crate::constant::codegen_const_value(fx, const_val, ret.layout().ty);
734736
ret.write_cvalue(fx, val);
735737
}

src/intrinsics/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
131131

132132
let idx = generic_args[2]
133133
.expect_const()
134-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(span))
134+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), span)
135135
.unwrap()
136136
.unwrap_branch();
137137

0 commit comments

Comments
 (0)