• B
    Auto merge of #49019 - phil-opp:target-spec, r=pnkfelix · d87c19db
    bors 提交于
    Introduce a TargetTriple enum to support absolute target paths
    
    This PR replaces target triple strings with a `TargetTriple` enum, which represents either a target triple or a path to a JSON target file. The path variant is used if the `--target` argument has a `.json` extension, else the target triple variant is used.
    
    The motivation of this PR is support for absolute target paths to avoid the need for setting the `RUST_TARGET_PATH` environment variable (see rust-lang/cargo#4905 for more information). For places where some kind of triple is needed (e.g. in the sysroot folder), we use the file name (without extension).
    
    For compatibility, we keep the old behavior of searching for a file named `$(target_triple).json` in `RUST_TARGET_PATH` for non-official target triples.
    d87c19db
link.rs 60.9 KB