Rollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=Zoxc
The (almost) culmination of HirIdification It's finally over. This PR removes old `FIXME`s and renames some functions so that the `HirId` variant has the shorter name. All that remains (and rightfully so) is stuff in `resolve`, `save_analysis` and (as far as I can tell) in a few places where we can't replace `NodeId` with `HirId`.
This commit is contained in:
commit
2e86c006f7
83 changed files with 309 additions and 321 deletions
|
|
@ -29,7 +29,7 @@ struct VarianceTest<'tcx> {
|
|||
|
||||
impl ItemLikeVisitor<'tcx> for VarianceTest<'tcx> {
|
||||
fn visit_item(&mut self, item: &'tcx hir::Item) {
|
||||
let item_def_id = self.tcx.hir().local_def_id_from_hir_id(item.hir_id);
|
||||
let item_def_id = self.tcx.hir().local_def_id(item.hir_id);
|
||||
|
||||
if let ItemKind::Ty(..) = item.node {
|
||||
for attr in self.tcx.get_attrs(item_def_id).iter() {
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
|
|||
impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
|
||||
fn check_nested_body(&mut self, body_id: hir::BodyId) -> Promotability {
|
||||
let item_id = self.tcx.hir().body_owner(body_id);
|
||||
let item_def_id = self.tcx.hir().local_def_id_from_hir_id(item_id);
|
||||
let item_def_id = self.tcx.hir().local_def_id(item_id);
|
||||
|
||||
let outer_in_fn = self.in_fn;
|
||||
let outer_tables = self.tables;
|
||||
|
|
@ -451,7 +451,7 @@ fn check_expr_kind<'a, 'tcx>(
|
|||
let nested_body_promotable = v.check_nested_body(body_id);
|
||||
// Paths in constant contexts cannot refer to local variables,
|
||||
// as there are none, and thus closures can't have upvars there.
|
||||
let closure_def_id = v.tcx.hir().local_def_id_from_hir_id(e.hir_id);
|
||||
let closure_def_id = v.tcx.hir().local_def_id(e.hir_id);
|
||||
if !v.tcx.upvars(closure_def_id).map_or(true, |v| v.is_empty()) {
|
||||
NotPromotable
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue