Skip to content

Commit 915d766

Browse files
committed
Use () for codegen queries.
1 parent 3a869ca commit 915d766

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/driver/aot.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn emit_module(
4141

4242
unwind_context.emit(&mut product);
4343

44-
let tmp_file = tcx.output_filenames(LOCAL_CRATE).temp_path(OutputType::Object, Some(&name));
44+
let tmp_file = tcx.output_filenames(()).temp_path(OutputType::Object, Some(&name));
4545
let obj = product.object.write().unwrap();
4646
if let Err(err) = std::fs::write(&tmp_file, obj) {
4747
tcx.sess.fatal(&format!("error writing object file: {}", err));
@@ -73,7 +73,7 @@ fn reuse_workproduct_for_cgu(
7373
let work_product = cgu.work_product(tcx);
7474
if let Some(saved_file) = &work_product.saved_file {
7575
let obj_out = tcx
76-
.output_filenames(LOCAL_CRATE)
76+
.output_filenames(())
7777
.temp_path(OutputType::Object, Some(&cgu.name().as_str()));
7878
object = Some(obj_out.clone());
7979
let source_file = rustc_incremental::in_incr_comp_dir(&incr_comp_session_dir, &saved_file);
@@ -179,7 +179,7 @@ pub(crate) fn run_aot(
179179
let mut work_products = FxHashMap::default();
180180

181181
let cgus = if tcx.sess.opts.output_types.should_codegen() {
182-
tcx.collect_and_partition_mono_items(LOCAL_CRATE).1
182+
tcx.collect_and_partition_mono_items(()).1
183183
} else {
184184
// If only `--emit metadata` is used, we shouldn't perform any codegen.
185185
// Also `tcx.collect_and_partition_mono_items` may panic in that case.
@@ -265,7 +265,7 @@ pub(crate) fn run_aot(
265265
.to_string();
266266

267267
let tmp_file = tcx
268-
.output_filenames(LOCAL_CRATE)
268+
.output_filenames(())
269269
.temp_path(OutputType::Metadata, Some(&metadata_cgu_name));
270270

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

344344
let output_object_file =
345-
tcx.output_filenames(LOCAL_CRATE).temp_path(OutputType::Object, Some(cgu_name));
345+
tcx.output_filenames(()).temp_path(OutputType::Object, Some(cgu_name));
346346

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

src/driver/jit.rs

+1-2
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())

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(()) => {}

0 commit comments

Comments
 (0)