Auto merge of #85178 - cjgillot:local-crate, r=oli-obk
Remove CrateNum parameter for queries that only work on local crate The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea. Using `()` as query key in those cases avoids having to worry about the validity of the query key.
This commit is contained in:
commit
3396a383bb
70 changed files with 281 additions and 404 deletions
|
@ -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;
|
||||
|
@ -805,9 +805,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;
|
||||
|
@ -816,15 +814,14 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
|
|||
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", || {
|
||||
tcx.ensure().proc_macro_decls_static(())
|
||||
});
|
||||
|
||||
sess.time("looking_for_derive_registrar", || proc_macro_decls::find(tcx));
|
||||
|
||||
let cstore = tcx
|
||||
.cstore_as_any()
|
||||
.downcast_ref::<CStore>()
|
||||
|
@ -903,11 +900,11 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
|
|||
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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue