Skip to content

Commit 268b798

Browse files
committed
apply suggestion
1 parent 0abd167 commit 268b798

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_mir_transform/src/check_unnecessary_transmutes.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@ impl<'tcx> Visitor<'tcx> for UnnecessaryTransmuteChecker<'_, 'tcx> {
9292
self.tcx.sess.source_map().span_to_snippet(arg).expect("ok"),
9393
span,
9494
)
95-
&& let Some(call_id) = self.body.source.def_id().as_local()
95+
&& let Some(hir_id) = terminator.source_info.scope.lint_root(&self.body.source_scopes)
9696
{
97-
let hir_id = self.tcx.local_def_id_to_hir_id(call_id);
98-
9997
self.tcx.emit_node_span_lint(UNNECESSARY_TRANSMUTATE, hir_id, span, lint);
10098
}
10199
}

0 commit comments

Comments
 (0)