Remove NodeId from Block and Expr#58698
Conversation
|
Oof, I forgot about the |
|
|
||
| let mut unsafe_blocks: Vec<_> = unsafe_blocks.into_iter().collect(); | ||
| unsafe_blocks.sort(); | ||
| unsafe_blocks.sort_by_cached_key(|(hir_id, _)| tcx.hir().hir_to_node_id(*hir_id)); |
There was a problem hiding this comment.
I think it's find to just use sort here. Do you know which errors changed order with that?
There was a problem hiding this comment.
Nope, plain sort breaks 2 issue test cases related to unused unsafe (unfortunately I forgot to register which ones).
There was a problem hiding this comment.
Well we can land sort_by_cached_key here and you could open a new PR with an additional commit which changes it back to sort, so we can look at the failures.
| s.s.space()?; | ||
| s.synth_comment(format!("node_id: {} hir local_id: {}", | ||
| expr.id, expr.hir_id.local_id.as_u32()))?; | ||
| s.synth_comment(format!("expr hir_id: {} hir local_id: {}", |
There was a problem hiding this comment.
You added expr here. Not sure if that's good or bad =P
There was a problem hiding this comment.
Yes, so that it matches the other branches; I mean, it shouldn't break anything ^^.
| Node::Expr(expr) => { | ||
| return (ty::Visibility::Restricted(tcx.hir().get_module_parent(expr.id)), | ||
| return (ty::Visibility::Restricted( | ||
| tcx.hir().get_module_parent_by_hir_id(expr.hir_id)), |
There was a problem hiding this comment.
This formatting doesn't quite make sense to me =P
There was a problem hiding this comment.
I think I was just trying to squeeze it so that tidy doesn't complain; I can adjust it if need be :P.
|
I've looked over this and it looks good. You can append it to #58561 |
|
@Zoxc done; what about that |
|
Oh, and closing in favor of #58561. |
|
@ljedrz That's probably due to padding. |
|
@Zoxc I ran tests with that plain |
The next iteration of #57578. The relevant part is the last 2 commits (the others are dependencies).
Removes
NodeIdfromhir::Blockhir::ExprBlocked by #58561, can be appended to it.
r? @Zoxc