diff options
| author | bors <bors@rust-lang.org> | 2018-12-07 20:04:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-12-07 20:04:06 +0000 |
| commit | 4a45578bc58ff262864f72680cc02e83f5d2f5b3 (patch) | |
| tree | 4adb79b3a93aab5d3f97dfe0f80ff9041f73fed8 /src/librustc_codegen_utils | |
| parent | a40fdeddd81965ee08344fbdd2dbdc04adf24561 (diff) | |
| parent | a70babed03d58d042024e41f0a46f7e33e34d0d1 (diff) | |
| download | rust-4a45578bc58ff262864f72680cc02e83f5d2f5b3.tar.gz rust-4a45578bc58ff262864f72680cc02e83f5d2f5b3.zip | |
Auto merge of #56502 - Zoxc:hir-func, r=eddyb
Use a function to access the Hir map to be able to turn it into a query later r? @eddyb
Diffstat (limited to 'src/librustc_codegen_utils')
| -rw-r--r-- | src/librustc_codegen_utils/lib.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_utils/symbol_names.rs | 4 | ||||
| -rw-r--r-- | src/librustc_codegen_utils/symbol_names_test.rs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_codegen_utils/lib.rs b/src/librustc_codegen_utils/lib.rs index ea8259d79a1..cbef3ff5b92 100644 --- a/src/librustc_codegen_utils/lib.rs +++ b/src/librustc_codegen_utils/lib.rs @@ -53,7 +53,7 @@ pub mod symbol_names_test; /// reporting an error. pub fn check_for_rustc_errors_attr(tcx: TyCtxt) { if let Some((id, span, _)) = *tcx.sess.entry_fn.borrow() { - let main_def_id = tcx.hir.local_def_id(id); + let main_def_id = tcx.hir().local_def_id(id); if tcx.has_attr(main_def_id, "rustc_error") { tcx.sess.span_fatal(span, "compilation successful"); diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs index 611d7b137c6..305c718ff06 100644 --- a/src/librustc_codegen_utils/symbol_names.rs +++ b/src/librustc_codegen_utils/symbol_names.rs @@ -250,7 +250,7 @@ fn compute_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, instance: Instance debug!("symbol_name(def_id={:?}, substs={:?})", def_id, substs); - let node_id = tcx.hir.as_local_node_id(def_id); + let node_id = tcx.hir().as_local_node_id(def_id); if let Some(id) = node_id { if *tcx.sess.plugin_registrar_fn.get() == Some(id) { @@ -265,7 +265,7 @@ fn compute_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, instance: Instance // FIXME(eddyb) Precompute a custom symbol name based on attributes. let is_foreign = if let Some(id) = node_id { - match tcx.hir.get(id) { + match tcx.hir().get(id) { Node::ForeignItem(_) => true, _ => false, } diff --git a/src/librustc_codegen_utils/symbol_names_test.rs b/src/librustc_codegen_utils/symbol_names_test.rs index 6eaf0c1c08d..c4ad31ab021 100644 --- a/src/librustc_codegen_utils/symbol_names_test.rs +++ b/src/librustc_codegen_utils/symbol_names_test.rs @@ -33,7 +33,7 @@ pub fn report_symbol_names<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { tcx.dep_graph.with_ignore(|| { let mut visitor = SymbolNamesTest { tcx }; - tcx.hir.krate().visit_all_item_likes(&mut visitor); + tcx.hir().krate().visit_all_item_likes(&mut visitor); }) } @@ -45,7 +45,7 @@ impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> { fn process_attrs(&mut self, node_id: ast::NodeId) { let tcx = self.tcx; - let def_id = tcx.hir.local_def_id(node_id); + let def_id = tcx.hir().local_def_id(node_id); for attr in tcx.get_attrs(def_id).iter() { if attr.check_name(SYMBOL_NAME) { // for now, can only use on monomorphic names |
