Skip to content

Commit 3396a38

Browse files
committed
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.
2 parents a55748f + 1ebf6d1 commit 3396a38

File tree

70 files changed

+280
-403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+280
-403
lines changed

compiler/rustc_codegen_cranelift/src/allocator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn codegen(
1313
module: &mut impl Module,
1414
unwind_context: &mut UnwindContext,
1515
) -> bool {
16-
let any_dynamic_crate = tcx.dependency_formats(LOCAL_CRATE).iter().any(|(_, list)| {
16+
let any_dynamic_crate = tcx.dependency_formats(()).iter().any(|(_, list)| {
1717
use rustc_middle::middle::dependency_format::Linkage;
1818
list.iter().any(|&linkage| linkage == Linkage::Dynamic)
1919
});

compiler/rustc_codegen_cranelift/src/driver/aot.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn emit_module(
4242

4343
unwind_context.emit(&mut product);
4444

45-
let tmp_file = tcx.output_filenames(LOCAL_CRATE).temp_path(OutputType::Object, Some(&name));
45+
let tmp_file = tcx.output_filenames(()).temp_path(OutputType::Object, Some(&name));
4646
let obj = product.object.write().unwrap();
4747
if let Err(err) = std::fs::write(&tmp_file, obj) {
4848
tcx.sess.fatal(&format!("error writing object file: {}", err));
@@ -74,7 +74,7 @@ fn reuse_workproduct_for_cgu(
7474
let work_product = cgu.work_product(tcx);
7575
if let Some(saved_file) = &work_product.saved_file {
7676
let obj_out = tcx
77-
.output_filenames(LOCAL_CRATE)
77+
.output_filenames(())
7878
.temp_path(OutputType::Object, Some(&cgu.name().as_str()));
7979
object = Some(obj_out.clone());
8080
let source_file = rustc_incremental::in_incr_comp_dir(&incr_comp_session_dir, &saved_file);
@@ -190,7 +190,7 @@ pub(crate) fn run_aot(
190190
let mut work_products = FxHashMap::default();
191191

192192
let cgus = if tcx.sess.opts.output_types.should_codegen() {
193-
tcx.collect_and_partition_mono_items(LOCAL_CRATE).1
193+
tcx.collect_and_partition_mono_items(()).1
194194
} else {
195195
// If only `--emit metadata` is used, we shouldn't perform any codegen.
196196
// Also `tcx.collect_and_partition_mono_items` may panic in that case.
@@ -276,7 +276,7 @@ pub(crate) fn run_aot(
276276
.to_string();
277277

278278
let tmp_file = tcx
279-
.output_filenames(LOCAL_CRATE)
279+
.output_filenames(())
280280
.temp_path(OutputType::Metadata, Some(&metadata_cgu_name));
281281

282282
let obj = crate::backend::with_object(tcx.sess, &metadata_cgu_name, |object| {
@@ -353,7 +353,7 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
353353
.join("\n");
354354

355355
let output_object_file =
356-
tcx.output_filenames(LOCAL_CRATE).temp_path(OutputType::Object, Some(cgu_name));
356+
tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu_name));
357357

358358
// Assemble `global_asm`
359359
let global_asm_object_file = add_file_stem_postfix(output_object_file.clone(), ".asm");

compiler/rustc_codegen_cranelift/src/driver/jit.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::os::raw::{c_char, c_int};
88
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
99
use rustc_codegen_ssa::CrateInfo;
1010
use rustc_middle::mir::mono::MonoItem;
11-
use rustc_session::config::EntryFnType;
1211

1312
use cranelift_jit::{JITBuilder, JITModule};
1413

@@ -66,7 +65,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
6665
matches!(backend_config.codegen_mode, CodegenMode::JitLazy),
6766
);
6867

69-
let (_, cgus) = tcx.collect_and_partition_mono_items(LOCAL_CRATE);
68+
let (_, cgus) = tcx.collect_and_partition_mono_items(());
7069
let mono_items = cgus
7170
.iter()
7271
.map(|cgu| cgu.items_in_deterministic_order(tcx).into_iter())
@@ -179,7 +178,7 @@ fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> {
179178
let mut dylib_paths = Vec::new();
180179

181180
let crate_info = CrateInfo::new(tcx);
182-
let formats = tcx.dependency_formats(LOCAL_CRATE);
181+
let formats = tcx.dependency_formats(());
183182
let data = &formats
184183
.iter()
185184
.find(|(crate_type, _data)| *crate_type == rustc_session::config::CrateType::Executable)

compiler/rustc_codegen_cranelift/src/main_shim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn maybe_create_entry_wrapper(
1515
unwind_context: &mut UnwindContext,
1616
is_jit: bool,
1717
) {
18-
let (main_def_id, is_main_fn) = match tcx.entry_fn(LOCAL_CRATE) {
18+
let (main_def_id, is_main_fn) = match tcx.entry_fn(()) {
1919
Some((def_id, entry_ty)) => (
2020
def_id,
2121
match entry_ty {

compiler/rustc_codegen_cranelift/src/pretty_clif.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ pub(crate) fn write_ir_file(
214214
return;
215215
}
216216

217-
let clif_output_dir = tcx.output_filenames(LOCAL_CRATE).with_extension("clif");
217+
let clif_output_dir = tcx.output_filenames(()).with_extension("clif");
218218

219219
match std::fs::create_dir(&clif_output_dir) {
220220
Ok(()) => {}

compiler/rustc_codegen_llvm/src/back/write.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use rustc_codegen_ssa::{CompiledModule, ModuleCodegen};
2020
use rustc_data_structures::small_c_str::SmallCStr;
2121
use rustc_errors::{FatalError, Handler, Level};
2222
use rustc_fs_util::{link_or_copy, path_to_c_string};
23-
use rustc_hir::def_id::LOCAL_CRATE;
2423
use rustc_middle::bug;
2524
use rustc_middle::ty::TyCtxt;
2625
use rustc_session::config::{self, Lto, OutputType, Passes, SwitchWithOptPath};
@@ -92,13 +91,12 @@ pub fn create_informational_target_machine(sess: &Session) -> &'static mut llvm:
9291

9392
pub fn create_target_machine(tcx: TyCtxt<'_>, mod_name: &str) -> &'static mut llvm::TargetMachine {
9493
let split_dwarf_file = if tcx.sess.target_can_use_split_dwarf() {
95-
tcx.output_filenames(LOCAL_CRATE)
96-
.split_dwarf_path(tcx.sess.split_debuginfo(), Some(mod_name))
94+
tcx.output_filenames(()).split_dwarf_path(tcx.sess.split_debuginfo(), Some(mod_name))
9795
} else {
9896
None
9997
};
10098
let config = TargetMachineFactoryConfig { split_dwarf_file };
101-
target_machine_factory(&tcx.sess, tcx.backend_optimization_level(LOCAL_CRATE))(config)
99+
target_machine_factory(&tcx.sess, tcx.backend_optimization_level(()))(config)
102100
.unwrap_or_else(|err| llvm_err(tcx.sess.diagnostic(), &err).raise())
103101
}
104102

compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use llvm::coverageinfo::CounterMappingRegion;
66
use rustc_codegen_ssa::coverageinfo::map::{Counter, CounterExpression};
77
use rustc_codegen_ssa::traits::{ConstMethods, CoverageInfoMethods};
88
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
9-
use rustc_hir::def_id::{DefId, DefIdSet, LOCAL_CRATE};
9+
use rustc_hir::def_id::{DefId, DefIdSet};
1010
use rustc_llvm::RustString;
1111
use rustc_middle::mir::coverage::CodeRegion;
1212
use rustc_span::Symbol;
@@ -265,7 +265,7 @@ fn add_unused_functions<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
265265
let ignore_unused_generics = tcx.sess.instrument_coverage_except_unused_generics();
266266

267267
let all_def_ids: DefIdSet = tcx
268-
.mir_keys(LOCAL_CRATE)
268+
.mir_keys(())
269269
.iter()
270270
.filter_map(|local_def_id| {
271271
let def_id = local_def_id.to_def_id();
@@ -276,7 +276,7 @@ fn add_unused_functions<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
276276
})
277277
.collect();
278278

279-
let codegenned_def_ids = tcx.codegened_and_inlined_items(LOCAL_CRATE);
279+
let codegenned_def_ids = tcx.codegened_and_inlined_items(());
280280

281281
let mut unused_def_ids_by_file: FxHashMap<Symbol, Vec<DefId>> = FxHashMap::default();
282282
for &non_codegenned_def_id in all_def_ids.difference(codegenned_def_ids) {

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,10 @@ pub fn compile_unit_metadata(
995995
let name_in_debuginfo = name_in_debuginfo.to_string_lossy();
996996
let work_dir = tcx.sess.working_dir.to_string_lossy(false);
997997
let flags = "\0";
998-
let out_dir = &tcx.output_filenames(LOCAL_CRATE).out_directory;
998+
let output_filenames = tcx.output_filenames(());
999+
let out_dir = &output_filenames.out_directory;
9991000
let split_name = if tcx.sess.target_can_use_split_dwarf() {
1000-
tcx.output_filenames(LOCAL_CRATE)
1001+
output_filenames
10011002
.split_dwarf_path(tcx.sess.split_debuginfo(), Some(codegen_unit_name))
10021003
.map(|f| out_dir.join(f))
10031004
} else {
@@ -1058,15 +1059,12 @@ pub fn compile_unit_metadata(
10581059
if tcx.sess.opts.debugging_opts.profile {
10591060
let cu_desc_metadata =
10601061
llvm::LLVMRustMetadataAsValue(debug_context.llcontext, unit_metadata);
1061-
let default_gcda_path = &tcx.output_filenames(LOCAL_CRATE).with_extension("gcda");
1062+
let default_gcda_path = &output_filenames.with_extension("gcda");
10621063
let gcda_path =
10631064
tcx.sess.opts.debugging_opts.profile_emit.as_ref().unwrap_or(default_gcda_path);
10641065

10651066
let gcov_cu_info = [
1066-
path_to_mdstring(
1067-
debug_context.llcontext,
1068-
&tcx.output_filenames(LOCAL_CRATE).with_extension("gcno"),
1069-
),
1067+
path_to_mdstring(debug_context.llcontext, &output_filenames.with_extension("gcno")),
10701068
path_to_mdstring(debug_context.llcontext, &gcda_path),
10711069
cu_desc_metadata,
10721070
];

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext, Variab
2323
use rustc_codegen_ssa::traits::*;
2424
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
2525
use rustc_data_structures::sync::Lrc;
26-
use rustc_hir::def_id::{DefId, DefIdMap, LOCAL_CRATE};
26+
use rustc_hir::def_id::{DefId, DefIdMap};
2727
use rustc_index::vec::IndexVec;
2828
use rustc_middle::mir;
2929
use rustc_middle::ty::layout::HasTyCtxt;
@@ -343,7 +343,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
343343
if self.sess().opts.optimize != config::OptLevel::No {
344344
spflags |= DISPFlags::SPFlagOptimized;
345345
}
346-
if let Some((id, _)) = self.tcx.entry_fn(LOCAL_CRATE) {
346+
if let Some((id, _)) = self.tcx.entry_fn(()) {
347347
if id == def_id {
348348
spflags |= DISPFlags::SPFlagMainSubprogram;
349349
}

compiler/rustc_codegen_ssa/src/back/linker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ fn exported_symbols(tcx: TyCtxt<'_>, crate_type: CrateType) -> Vec<String> {
13031303
}
13041304
}
13051305

1306-
let formats = tcx.dependency_formats(LOCAL_CRATE);
1306+
let formats = tcx.dependency_formats(());
13071307
let deps = formats.iter().find_map(|(t, list)| (*t == crate_type).then_some(list)).unwrap();
13081308

13091309
for (index, dep_format) in deps.iter().enumerate() {

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+13-19
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_ast::expand::allocator::ALLOCATOR_METHODS;
44
use rustc_data_structures::fingerprint::Fingerprint;
55
use rustc_data_structures::fx::FxHashMap;
66
use rustc_hir as hir;
7-
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE};
7+
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
88
use rustc_hir::Node;
99
use rustc_index::vec::IndexVec;
1010
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
@@ -60,7 +60,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap<
6060
tcx.is_panic_runtime(LOCAL_CRATE) || tcx.is_compiler_builtins(LOCAL_CRATE);
6161

6262
let mut reachable_non_generics: DefIdMap<_> = tcx
63-
.reachable_set(LOCAL_CRATE)
63+
.reachable_set(())
6464
.iter()
6565
.filter_map(|&def_id| {
6666
// We want to ignore some FFI functions that are not exposed from
@@ -133,12 +133,12 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap<
133133
})
134134
.collect();
135135

136-
if let Some(id) = tcx.proc_macro_decls_static(LOCAL_CRATE) {
137-
reachable_non_generics.insert(id, SymbolExportLevel::C);
136+
if let Some(id) = tcx.proc_macro_decls_static(()) {
137+
reachable_non_generics.insert(id.to_def_id(), SymbolExportLevel::C);
138138
}
139139

140-
if let Some(id) = tcx.plugin_registrar_fn(LOCAL_CRATE) {
141-
reachable_non_generics.insert(id, SymbolExportLevel::C);
140+
if let Some(id) = tcx.plugin_registrar_fn(()) {
141+
reachable_non_generics.insert(id.to_def_id(), SymbolExportLevel::C);
142142
}
143143

144144
reachable_non_generics
@@ -174,7 +174,7 @@ fn exported_symbols_provider_local(
174174
.map(|(&def_id, &level)| (ExportedSymbol::NonGeneric(def_id), level))
175175
.collect();
176176

177-
if tcx.entry_fn(LOCAL_CRATE).is_some() {
177+
if tcx.entry_fn(()).is_some() {
178178
let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, "main"));
179179

180180
symbols.push((exported_symbol, SymbolExportLevel::C));
@@ -230,7 +230,7 @@ fn exported_symbols_provider_local(
230230
// external linkage is enough for monomorphization to be linked to.
231231
let need_visibility = tcx.sess.target.dynamic_linking && !tcx.sess.target.only_cdylib;
232232

233-
let (_, cgus) = tcx.collect_and_partition_mono_items(LOCAL_CRATE);
233+
let (_, cgus) = tcx.collect_and_partition_mono_items(());
234234

235235
for (mono_item, &(linkage, visibility)) in cgus.iter().flat_map(|cgu| cgu.items().iter()) {
236236
if linkage != Linkage::External {
@@ -275,11 +275,9 @@ fn exported_symbols_provider_local(
275275

276276
fn upstream_monomorphizations_provider(
277277
tcx: TyCtxt<'_>,
278-
cnum: CrateNum,
278+
(): (),
279279
) -> DefIdMap<FxHashMap<SubstsRef<'_>, CrateNum>> {
280-
debug_assert!(cnum == LOCAL_CRATE);
281-
282-
let cnums = tcx.all_crate_nums(LOCAL_CRATE);
280+
let cnums = tcx.all_crate_nums(());
283281

284282
let mut instances: DefIdMap<FxHashMap<_, _>> = Default::default();
285283

@@ -341,7 +339,7 @@ fn upstream_monomorphizations_for_provider(
341339
def_id: DefId,
342340
) -> Option<&FxHashMap<SubstsRef<'_>, CrateNum>> {
343341
debug_assert!(!def_id.is_local());
344-
tcx.upstream_monomorphizations(LOCAL_CRATE).get(&def_id)
342+
tcx.upstream_monomorphizations(()).get(&def_id)
345343
}
346344

347345
fn upstream_drop_glue_for_provider<'tcx>(
@@ -355,12 +353,8 @@ fn upstream_drop_glue_for_provider<'tcx>(
355353
}
356354
}
357355

358-
fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
359-
if let Some(def_id) = def_id.as_local() {
360-
!tcx.reachable_set(LOCAL_CRATE).contains(&def_id)
361-
} else {
362-
bug!("is_unreachable_local_definition called with non-local DefId: {:?}", def_id)
363-
}
356+
fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
357+
!tcx.reachable_set(()).contains(&def_id)
364358
}
365359

366360
pub fn provide(providers: &mut Providers) {

compiler/rustc_codegen_ssa/src/back/write.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
482482
codegen_worker_receive,
483483
shared_emitter_main,
484484
future: coordinator_thread,
485-
output_filenames: tcx.output_filenames(LOCAL_CRATE),
485+
output_filenames: tcx.output_filenames(()),
486486
}
487487
}
488488

@@ -1042,7 +1042,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
10421042
// If we know that we won’t be doing codegen, create target machines without optimisation.
10431043
config::OptLevel::No
10441044
} else {
1045-
tcx.backend_optimization_level(LOCAL_CRATE)
1045+
tcx.backend_optimization_level(())
10461046
};
10471047
let cgcx = CodegenContext::<B> {
10481048
backend: backend.clone(),
@@ -1061,7 +1061,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
10611061
cgu_reuse_tracker: sess.cgu_reuse_tracker.clone(),
10621062
coordinator_send,
10631063
diag_emitter: shared_emitter.clone(),
1064-
output_filenames: tcx.output_filenames(LOCAL_CRATE),
1064+
output_filenames: tcx.output_filenames(()),
10651065
regular_module_config: regular_config,
10661066
metadata_module_config: metadata_config,
10671067
allocator_module_config: allocator_config,

compiler/rustc_codegen_ssa/src/base.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
347347
pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
348348
cx: &'a Bx::CodegenCx,
349349
) -> Option<Bx::Function> {
350-
let main_def_id = cx.tcx().entry_fn(LOCAL_CRATE).map(|(def_id, _)| def_id)?;
350+
let (main_def_id, entry_type) = cx.tcx().entry_fn(())?;
351351
let main_is_local = main_def_id.is_local();
352352
let instance = Instance::mono(cx.tcx(), main_def_id);
353353

@@ -364,10 +364,9 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
364364

365365
let main_llfn = cx.get_fn_addr(instance);
366366

367-
return cx.tcx().entry_fn(LOCAL_CRATE).map(|(_, et)| {
368-
let use_start_lang_item = EntryFnType::Start != et;
369-
create_entry_fn::<Bx>(cx, main_llfn, main_def_id, use_start_lang_item)
370-
});
367+
let use_start_lang_item = EntryFnType::Start != entry_type;
368+
let entry_fn = create_entry_fn::<Bx>(cx, main_llfn, main_def_id, use_start_lang_item);
369+
return Some(entry_fn);
371370

372371
fn create_entry_fn<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
373372
cx: &'a Bx::CodegenCx,
@@ -487,7 +486,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
487486

488487
// Run the monomorphization collector and partition the collected items into
489488
// codegen units.
490-
let codegen_units = tcx.collect_and_partition_mono_items(LOCAL_CRATE).1;
489+
let codegen_units = tcx.collect_and_partition_mono_items(()).1;
491490

492491
// Force all codegen_unit queries so they are already either red or green
493492
// when compile_codegen_unit accesses them. We are not able to re-execute
@@ -512,7 +511,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
512511
// linkage, then it's already got an allocator shim and we'll be using that
513512
// one instead. If nothing exists then it's our job to generate the
514513
// allocator!
515-
let any_dynamic_crate = tcx.dependency_formats(LOCAL_CRATE).iter().any(|(_, list)| {
514+
let any_dynamic_crate = tcx.dependency_formats(()).iter().any(|(_, list)| {
516515
use rustc_middle::middle::dependency_format::Linkage;
517516
list.iter().any(|&linkage| linkage == Linkage::Dynamic)
518517
});
@@ -769,7 +768,7 @@ impl CrateInfo {
769768
used_crate_source: Default::default(),
770769
lang_item_to_crate: Default::default(),
771770
missing_lang_items: Default::default(),
772-
dependency_formats: tcx.dependency_formats(LOCAL_CRATE),
771+
dependency_formats: tcx.dependency_formats(()),
773772
};
774773
let lang_items = tcx.lang_items();
775774

compiler/rustc_driver/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use rustc_data_structures::sync::SeqCst;
2121
use rustc_errors::registry::{InvalidErrorCode, Registry};
2222
use rustc_errors::{ErrorReported, PResult};
2323
use rustc_feature::find_gated_cfg;
24-
use rustc_hir::def_id::LOCAL_CRATE;
2524
use rustc_interface::util::{self, collect_crate_types, get_builtin_codegen_backend};
2625
use rustc_interface::{interface, Queries};
2726
use rustc_lint::LintStore;
@@ -389,7 +388,7 @@ fn run_compiler(
389388
}
390389

391390
queries.global_ctxt()?.peek_mut().enter(|tcx| {
392-
let result = tcx.analysis(LOCAL_CRATE);
391+
let result = tcx.analysis(());
393392
if sess.opts.debugging_opts.save_analysis {
394393
let crate_name = queries.crate_name()?.peek().clone();
395394
sess.time("save_analysis", || {

0 commit comments

Comments
 (0)