1
Fork 0

Rollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514

Use TargetTriple::from_path in rustdoc

This fixes the problem reported in https://github.com/Rust-for-Linux/linux/pull/272 where rustdoc requires the absolute path of a target spec json instead of accepting a relative path like rustc.
This commit is contained in:
Guillaume Gomez 2021-05-25 13:05:09 +02:00 committed by GitHub
commit 6b0b81b098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 11 deletions

View file

@ -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);