diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-07-05 20:26:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-05 20:26:56 +0200 |
| commit | 2e86c006f73c6facd38bf82ffd502dcff3864c28 (patch) | |
| tree | 288c6e7eabb239910746a930301c0ba5653cea48 /src/librustc_interface | |
| parent | b41a62ef69ef6886f4a7c59fc2cdc2cc44608936 (diff) | |
| parent | a6030ff699e24a2d8f09bfd833361f119a9f0633 (diff) | |
| download | rust-2e86c006f73c6facd38bf82ffd502dcff3864c28.tar.gz rust-2e86c006f73c6facd38bf82ffd502dcff3864c28.zip | |
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`.
Diffstat (limited to 'src/librustc_interface')
| -rw-r--r-- | src/librustc_interface/passes.rs | 13 | ||||
| -rw-r--r-- | src/librustc_interface/proc_macro_decls.rs | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index d6987281981..9a5eb2b93d5 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -899,9 +899,10 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> { }); }, { par_iter(&tcx.hir().krate().modules).for_each(|(&module, _)| { - tcx.ensure().check_mod_loops(tcx.hir().local_def_id(module)); - tcx.ensure().check_mod_attrs(tcx.hir().local_def_id(module)); - tcx.ensure().check_mod_unstable_api_usage(tcx.hir().local_def_id(module)); + tcx.ensure().check_mod_loops(tcx.hir().local_def_id_from_node_id(module)); + tcx.ensure().check_mod_attrs(tcx.hir().local_def_id_from_node_id(module)); + tcx.ensure().check_mod_unstable_api_usage( + tcx.hir().local_def_id_from_node_id(module)); }); }); }); @@ -924,9 +925,9 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> { // "not all control paths return a value" is reported here. // // maybe move the check to a MIR pass? - tcx.ensure().check_mod_liveness(tcx.hir().local_def_id(module)); + tcx.ensure().check_mod_liveness(tcx.hir().local_def_id_from_node_id(module)); - tcx.ensure().check_mod_intrinsics(tcx.hir().local_def_id(module)); + tcx.ensure().check_mod_intrinsics(tcx.hir().local_def_id_from_node_id(module)); }); }); }); @@ -986,7 +987,7 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> { }, { time(sess, "privacy checking modules", || { par_iter(&tcx.hir().krate().modules).for_each(|(&module, _)| { - tcx.ensure().check_mod_privacy(tcx.hir().local_def_id(module)); + tcx.ensure().check_mod_privacy(tcx.hir().local_def_id_from_node_id(module)); }); }); }); diff --git a/src/librustc_interface/proc_macro_decls.rs b/src/librustc_interface/proc_macro_decls.rs index d888c9e57d3..56180bcad06 100644 --- a/src/librustc_interface/proc_macro_decls.rs +++ b/src/librustc_interface/proc_macro_decls.rs @@ -16,7 +16,7 @@ fn proc_macro_decls_static(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<DefId> { let mut finder = Finder { decls: None }; tcx.hir().krate().visit_all_item_likes(&mut finder); - finder.decls.map(|id| tcx.hir().local_def_id_from_hir_id(id)) + finder.decls.map(|id| tcx.hir().local_def_id(id)) } struct Finder { |
