Fix review comments
This commit is contained in:
@@ -18,7 +18,7 @@ use rustc_parse::parser::attr::AllowLeadingUnsafe;
|
||||
use rustc_query_impl::QueryCtxt;
|
||||
use rustc_query_system::query::print_query_stack;
|
||||
use rustc_session::config::{self, Cfg, CheckCfg, ExpectedValues, Input, OutFileName};
|
||||
use rustc_session::filesearch::get_or_default_sysroot;
|
||||
use rustc_session::filesearch::sysroot_with_fallback;
|
||||
use rustc_session::parse::ParseSess;
|
||||
use rustc_session::{CompilerIO, EarlyDiagCtxt, Session, lint};
|
||||
use rustc_span::source_map::{FileLoader, RealFileLoader, SourceMapInputs};
|
||||
@@ -442,8 +442,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
|
||||
let temps_dir = config.opts.unstable_opts.temps_dir.as_deref().map(PathBuf::from);
|
||||
|
||||
let bundle = match rustc_errors::fluent_bundle(
|
||||
config.opts.sysroot.clone(),
|
||||
get_or_default_sysroot(),
|
||||
sysroot_with_fallback(&config.opts.sysroot),
|
||||
config.opts.unstable_opts.translate_lang.clone(),
|
||||
config.opts.unstable_opts.translate_additional_ftl.as_deref(),
|
||||
config.opts.unstable_opts.translate_directionality_markers,
|
||||
|
||||
@@ -345,14 +345,10 @@ pub fn rustc_path<'a>() -> Option<&'a Path> {
|
||||
}
|
||||
|
||||
fn get_rustc_path_inner(bin_path: &str) -> Option<PathBuf> {
|
||||
Some(filesearch::get_or_default_sysroot()).iter().find_map(|sysroot| {
|
||||
let candidate = sysroot.join(bin_path).join(if cfg!(target_os = "windows") {
|
||||
"rustc.exe"
|
||||
} else {
|
||||
"rustc"
|
||||
});
|
||||
candidate.exists().then_some(candidate)
|
||||
})
|
||||
let candidate = filesearch::get_or_default_sysroot()
|
||||
.join(bin_path)
|
||||
.join(if cfg!(target_os = "windows") { "rustc.exe" } else { "rustc" });
|
||||
candidate.exists().then_some(candidate)
|
||||
}
|
||||
|
||||
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
||||
|
||||
Reference in New Issue
Block a user