Skip to content

Commit 17b0895

Browse files
committed
Remove operand_span for switchint discr_span
it is causing incorrect results for 1.86 as rustc doesn't generate temporaries for switchints compiled from simple ifs anymore
1 parent 91767f2 commit 17b0895

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/analyz/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,6 @@ impl<'tcx> ToJson<'tcx> for mir::Statement<'tcx> {
490490
}
491491
}
492492

493-
fn operand_span(mir: &MirState, op: &mir::Operand) -> Option<Span> {
494-
let local = op.place()?.as_local()?;
495-
Some(mir.mir?.local_decls[local].source_info.span)
496-
}
497-
498493
impl ToJson<'_> for Span {
499494
fn to_json(&self, mir: &mut MirState) -> serde_json::Value {
500495
let source_map = mir.state.session.source_map();
@@ -526,7 +521,6 @@ impl<'tcx> ToJson<'tcx> for mir::Terminator<'tcx> {
526521
let vals: Vec<String> =
527522
targets.iter().map(|(c, _)| c.to_string()).collect();
528523
let discr_span = mir.match_span_map.get(&self.source_info.span).cloned()
529-
.or_else(|| operand_span(mir, discr))
530524
.unwrap_or(self.source_info.span);
531525
json!({
532526
"kind": "SwitchInt",

0 commit comments

Comments
 (0)