1
Fork 0

Use () for analysis.

This commit is contained in:
Camille GILLOT 2021-05-11 14:50:54 +02:00
parent 0bde3b1f80
commit 1fb9cad50a
9 changed files with 16 additions and 24 deletions

View file

@ -12,7 +12,7 @@ use rustc_data_structures::temp_dir::MaybeTempDir;
use rustc_data_structures::{box_region_allow_access, declare_box_region_type, parallel};
use rustc_errors::{ErrorReported, PResult};
use rustc_expand::base::ExtCtxt;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_hir::Crate;
use rustc_lint::LintStore;
use rustc_metadata::creader::CStore;
@ -809,9 +809,7 @@ pub fn create_global_ctxt<'tcx>(
/// Runs the resolution, type-checking, region checking and other
/// miscellaneous analysis passes on the crate.
fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
assert_eq!(cnum, LOCAL_CRATE);
fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
rustc_passes::hir_id_validator::check_crate(tcx);
let sess = tcx.sess;

View file

@ -285,7 +285,7 @@ impl<'tcx> Queries<'tcx> {
self.ongoing_codegen.compute(|| {
let outputs = self.prepare_outputs()?;
self.global_ctxt()?.peek_mut().enter(|tcx| {
tcx.analysis(LOCAL_CRATE).ok();
tcx.analysis(()).ok();
// Don't do code generation if there were any errors
self.session().compile_status()?;