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;
/// 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;
sess.time("misc_checking_1", || {
parallel!(
{
- entry_point = sess
- .time("looking_for_entry_point", || rustc_passes::entry::find_entry_point(tcx));
+ entry_point = sess.time("looking_for_entry_point", || tcx.entry_fn(()));
- sess.time("looking_for_plugin_registrar", || {
- plugin::build::find_plugin_registrar(tcx)
- });
+ sess.time("looking_for_plugin_registrar", || tcx.ensure().plugin_registrar_fn(()));
- sess.time("looking_for_derive_registrar", || proc_macro_decls::find(tcx));
+ sess.time("looking_for_derive_registrar", || {
+ tcx.ensure().proc_macro_decls_static(())
+ });
let cstore = tcx
.cstore_as_any()
sess.time("misc_checking_3", || {
parallel!(
{
- tcx.ensure().privacy_access_levels(LOCAL_CRATE);
+ tcx.ensure().privacy_access_levels(());
parallel!(
{
- tcx.ensure().check_private_in_public(LOCAL_CRATE);
+ tcx.ensure().check_private_in_public(());
},
{
sess.time("death_checking", || rustc_passes::dead::check_crate(tcx));