Skip to content

Commit

Permalink
sort unused unsafe blocks by Span instead of NodeId
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Apr 16, 2020
1 parent d167408 commit 672b768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/check_unsafety.rs
Expand Up @@ -649,7 +649,7 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: DefId) {
unsafe_unused.push(block_id);
}
}
unsafe_unused.sort_by_cached_key(|hir_id| tcx.hir().hir_id_to_node_id(*hir_id));
unsafe_unused.sort_by_cached_key(|hir_id| tcx.hir().span(*hir_id));

for &block_id in &unsafe_unused {
report_unused_unsafe(tcx, &unsafe_used, block_id);
Expand Down

0 comments on commit 672b768

Please sign in to comment.