1
Fork 0

Avoid various uses of Option<Span> in favor of using DUMMY_SP in the few cases that used None

This commit is contained in:
Oli Scherer 2024-03-14 09:10:28 +00:00
parent a42873e85b
commit adda9da604
34 changed files with 70 additions and 75 deletions

View file

@ -56,7 +56,7 @@ impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
fn visit_constant(&mut self, constant: &mut mir::ConstOperand<'tcx>, location: mir::Location) {
let const_ = self.monomorphize(constant.const_);
let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), Some(constant.span)) {
let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), constant.span) {
Ok(v) => v,
Err(mir::interpret::ErrorHandled::Reported(..)) => return,
Err(mir::interpret::ErrorHandled::TooGeneric(..)) => {

View file

@ -566,7 +566,7 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
let result = tcx.const_eval_instance(
ParamEnv::reveal_all(),
instance,
Some(tcx.def_span(instance.def_id())),
tcx.def_span(instance.def_id()),
);
result
.map(|const_val| {