Avoid various uses of Option<Span>
in favor of using DUMMY_SP
in the few cases that used None
This commit is contained in:
parent
a42873e85b
commit
adda9da604
34 changed files with 70 additions and 75 deletions
|
@ -394,7 +394,7 @@ impl<'a, 'tcx> ConstAnalysis<'a, 'tcx> {
|
|||
}
|
||||
Operand::Constant(box constant) => {
|
||||
if let Ok(constant) =
|
||||
self.ecx.eval_mir_constant(&constant.const_, Some(constant.span), None)
|
||||
self.ecx.eval_mir_constant(&constant.const_, constant.span, None)
|
||||
{
|
||||
self.assign_constant(state, place, constant, &[]);
|
||||
}
|
||||
|
|
|
@ -367,7 +367,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
Repeat(..) => return None,
|
||||
|
||||
Constant { ref value, disambiguator: _ } => {
|
||||
self.ecx.eval_mir_constant(value, None, None).ok()?
|
||||
self.ecx.eval_mir_constant(value, DUMMY_SP, None).ok()?
|
||||
}
|
||||
Aggregate(kind, variant, ref fields) => {
|
||||
let fields = fields
|
||||
|
|
|
@ -417,7 +417,7 @@ impl<'tcx, 'a> TOFinder<'tcx, 'a> {
|
|||
// If we expect `lhs ?= A`, we have an opportunity if we assume `constant == A`.
|
||||
Operand::Constant(constant) => {
|
||||
let constant =
|
||||
self.ecx.eval_mir_constant(&constant.const_, Some(constant.span), None).ok()?;
|
||||
self.ecx.eval_mir_constant(&constant.const_, constant.span, None).ok()?;
|
||||
self.process_constant(bb, lhs, constant, state);
|
||||
}
|
||||
// Transfer the conditions on the copied rhs.
|
||||
|
|
|
@ -261,7 +261,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
|
|||
// manually normalized.
|
||||
let val = self.tcx.try_normalize_erasing_regions(self.param_env, c.const_).ok()?;
|
||||
|
||||
self.use_ecx(|this| this.ecx.eval_mir_constant(&val, Some(c.span), None))?
|
||||
self.use_ecx(|this| this.ecx.eval_mir_constant(&val, c.span, None))?
|
||||
.as_mplace_or_imm()
|
||||
.right()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue