Use a function to access the Hir map to be able to turn it into a query later

This commit is contained in:
John Kåre Alsaker
2018-12-04 13:45:36 +01:00
parent 367e783e6f
commit a70babed03
160 changed files with 1220 additions and 1210 deletions

View File

@@ -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");