Skip to content

Commit fbe2d5a

Browse files
committed
Remove output_filenames field from TyCtxt and feed the query instead
1 parent 33b6a77 commit fbe2d5a

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

compiler/rustc_interface/src/passes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ pub fn create_global_ctxt<'tcx>(
822822
queries.on_disk_cache.as_ref().map(OnDiskCache::as_dyn),
823823
queries.as_dyn(),
824824
rustc_query_impl::query_callbacks(arena),
825-
outputs,
826825
)
827826
})
828827
});
@@ -834,6 +833,7 @@ pub fn create_global_ctxt<'tcx>(
834833
tcx.arena.alloc(Steal::new((untracked_resolver_for_lowering, krate))),
835834
);
836835
feed.resolutions(tcx.arena.alloc(untracked_resolutions));
836+
feed.output_filenames(tcx.arena.alloc(std::sync::Arc::new(outputs)));
837837
let feed = tcx.feed_local_crate();
838838
feed.crate_name(crate_name);
839839
});

compiler/rustc_middle/src/arena.rs

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ macro_rules! arena_types {
3434
rustc_middle::ty::ResolverAstLowering,
3535
rustc_data_structures::sync::Lrc<rustc_ast::Crate>,
3636
)>,
37+
[] output_filenames: std::sync::Arc<rustc_session::config::OutputFilenames>,
3738
[] resolutions: rustc_middle::ty::ResolverGlobalCtxt,
3839
[decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
3940
[decode] code_region: rustc_middle::mir::coverage::CodeRegion,

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,7 @@ rustc_queries! {
18571857
/// This query returns an `&Arc` because codegen backends need the value even after the `TyCtxt`
18581858
/// has been destroyed.
18591859
query output_filenames(_: ()) -> &'tcx Arc<OutputFilenames> {
1860-
eval_always
1860+
feedable
18611861
desc { "getting output filenames" }
18621862
}
18631863

compiler/rustc_middle/src/ty/context.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use rustc_macros::HashStable;
5151
use rustc_query_system::dep_graph::DepNodeIndex;
5252
use rustc_query_system::ich::StableHashingContext;
5353
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
54-
use rustc_session::config::{CrateType, OutputFilenames};
54+
use rustc_session::config::CrateType;
5555
use rustc_session::cstore::{CrateStoreDyn, Untracked};
5656
use rustc_session::lint::Lint;
5757
use rustc_session::Limit;
@@ -74,7 +74,6 @@ use std::hash::{Hash, Hasher};
7474
use std::iter;
7575
use std::mem;
7676
use std::ops::{Bound, Deref};
77-
use std::sync::Arc;
7877

7978
pub trait OnDiskCache<'tcx>: rustc_data_structures::sync::Sync {
8079
/// Creates a new `OnDiskCache` instance from the serialized data in `data`.
@@ -460,8 +459,6 @@ pub struct GlobalCtxt<'tcx> {
460459

461460
/// Stores memory for globals (statics/consts).
462461
pub(crate) alloc_map: Lock<interpret::AllocMap<'tcx>>,
463-
464-
output_filenames: Arc<OutputFilenames>,
465462
}
466463

467464
impl<'tcx> TyCtxt<'tcx> {
@@ -591,7 +588,6 @@ impl<'tcx> TyCtxt<'tcx> {
591588
on_disk_cache: Option<&'tcx dyn OnDiskCache<'tcx>>,
592589
queries: &'tcx dyn query::QueryEngine<'tcx>,
593590
query_kinds: &'tcx [DepKindStruct<'tcx>],
594-
output_filenames: OutputFilenames,
595591
) -> GlobalCtxt<'tcx> {
596592
let data_layout = s.target.parse_data_layout().unwrap_or_else(|err| {
597593
s.emit_fatal(err);
@@ -623,7 +619,6 @@ impl<'tcx> TyCtxt<'tcx> {
623619
evaluation_cache: Default::default(),
624620
data_layout,
625621
alloc_map: Lock::new(interpret::AllocMap::new()),
626-
output_filenames: Arc::new(output_filenames),
627622
}
628623
}
629624

@@ -2407,7 +2402,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
24072402

24082403
providers.extern_mod_stmt_cnum =
24092404
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
2410-
providers.output_filenames = |tcx, ()| &tcx.output_filenames;
24112405
providers.features_query = |tcx, ()| tcx.sess.features_untracked();
24122406
providers.is_panic_runtime = |tcx, cnum| {
24132407
assert_eq!(cnum, LOCAL_CRATE);

0 commit comments

Comments
 (0)