summary refs log tree commit diff
path: root/compiler/rustc_save_analysis/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-17 01:42:03 +0000
committerbors <bors@rust-lang.org>2021-05-17 01:42:03 +0000
commit3396a383bb1d1fdad8ceeb74f16cf08e0bd62a1b (patch)
tree912246be6d9298983c099d904ee9260e77695a62 /compiler/rustc_save_analysis/src
parenta55748ffe94e71f841c7b1d752779b0db138b342 (diff)
parent1ebf6d12426152dc1ce76c174ee0ff69b1a4c5b4 (diff)
downloadrust-3396a383bb1d1fdad8ceeb74f16cf08e0bd62a1b.tar.gz
rust-3396a383bb1d1fdad8ceeb74f16cf08e0bd62a1b.zip
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.
Diffstat (limited to 'compiler/rustc_save_analysis/src')
-rw-r--r--compiler/rustc_save_analysis/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs
index bcd125ae01d..6c308ad89db 100644
--- a/compiler/rustc_save_analysis/src/lib.rs
+++ b/compiler/rustc_save_analysis/src/lib.rs
@@ -95,7 +95,7 @@ impl<'tcx> SaveContext<'tcx> {
         let sess = &self.tcx.sess;
         // Save-analysis is emitted per whole session, not per each crate type
         let crate_type = sess.crate_types()[0];
-        let outputs = &*self.tcx.output_filenames(LOCAL_CRATE);
+        let outputs = &*self.tcx.output_filenames(());
 
         if outputs.outputs.contains_key(&OutputType::Metadata) {
             filename_for_metadata(sess, crate_name, outputs)
@@ -1000,7 +1000,7 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>(
             // Privacy checking requires and is done after type checking; use a
             // fallback in case the access levels couldn't have been correctly computed.
             let access_levels = match tcx.sess.compile_status() {
-                Ok(..) => tcx.privacy_access_levels(LOCAL_CRATE),
+                Ok(..) => tcx.privacy_access_levels(()),
                 Err(..) => tcx.arena.alloc(AccessLevels::default()),
             };