Skip to content

Commit 3a02cdb

Browse files
committed
Remove constant parameter from CrateLocator::new
1 parent e1ac0fa commit 3a02cdb

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

compiler/rustc_metadata/src/creader.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,6 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
581581
self.tcx.crate_types().iter().all(|c| *c == CrateType::Rlib),
582582
hash,
583583
extra_filename,
584-
false, // is_host
585584
path_kind,
586585
);
587586

compiler/rustc_metadata/src/locator.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ use rustc_data_structures::owned_slice::slice_owned;
222222
use rustc_data_structures::svh::Svh;
223223
use rustc_errors::{DiagArgValue, IntoDiagArg};
224224
use rustc_fs_util::try_canonicalize;
225-
use rustc_session::config;
226225
use rustc_session::cstore::CrateSource;
227226
use rustc_session::filesearch::FileSearch;
228227
use rustc_session::search_paths::PathKind;
@@ -309,7 +308,6 @@ impl<'a> CrateLocator<'a> {
309308
is_rlib: bool,
310309
hash: Option<Svh>,
311310
extra_filename: Option<&'a str>,
312-
is_host: bool,
313311
path_kind: PathKind,
314312
) -> CrateLocator<'a> {
315313
let needs_object_code = sess.opts.output_types.should_codegen();
@@ -340,17 +338,9 @@ impl<'a> CrateLocator<'a> {
340338
},
341339
hash,
342340
extra_filename,
343-
target: if is_host { &sess.host } else { &sess.target },
344-
triple: if is_host {
345-
TargetTriple::from_triple(config::host_triple())
346-
} else {
347-
sess.opts.target_triple.clone()
348-
},
349-
filesearch: if is_host {
350-
sess.host_filesearch(path_kind)
351-
} else {
352-
sess.target_filesearch(path_kind)
353-
},
341+
target: &sess.target,
342+
triple: sess.opts.target_triple.clone(),
343+
filesearch: sess.target_filesearch(path_kind),
354344
is_proc_macro: false,
355345
crate_rejections: CrateRejections::default(),
356346
}

0 commit comments

Comments
 (0)