mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-07 12:33:14 +00:00
Use parse_target_triple in rustdoc
This commit is contained in:
parent
8260b8325c
commit
f22a80890a
@ -1507,7 +1507,10 @@ fn collect_print_requests(
|
||||
prints
|
||||
}
|
||||
|
||||
fn parse_target_triple(matches: &getopts::Matches, error_format: ErrorOutputType) -> TargetTriple {
|
||||
pub fn parse_target_triple(
|
||||
matches: &getopts::Matches,
|
||||
error_format: ErrorOutputType,
|
||||
) -> TargetTriple {
|
||||
match matches.opt_str("target") {
|
||||
Some(target) if target.ends_with(".json") => {
|
||||
let path = Path::new(&target);
|
||||
|
@ -6,8 +6,10 @@ use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_session::config::{self, parse_crate_types_from_list, parse_externs, CrateType};
|
||||
use rustc_session::config::{get_cmd_lint_options, host_triple, nightly_options};
|
||||
use rustc_session::config::{
|
||||
self, parse_crate_types_from_list, parse_externs, parse_target_triple, CrateType,
|
||||
};
|
||||
use rustc_session::config::{get_cmd_lint_options, nightly_options};
|
||||
use rustc_session::config::{CodegenOptions, DebuggingOptions, ErrorOutputType, Externs};
|
||||
use rustc_session::getopts;
|
||||
use rustc_session::lint::Level;
|
||||
@ -562,14 +564,7 @@ impl Options {
|
||||
}
|
||||
}
|
||||
|
||||
let target =
|
||||
matches.opt_str("target").map_or(TargetTriple::from_triple(host_triple()), |target| {
|
||||
if target.ends_with(".json") {
|
||||
TargetTriple::from_path(Path::new(&target))
|
||||
} else {
|
||||
TargetTriple::TargetTriple(target)
|
||||
}
|
||||
});
|
||||
let target = parse_target_triple(matches, error_format);
|
||||
|
||||
let show_coverage = matches.opt_present("show-coverage");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user