mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Auto merge of #14564 - epage:rustup, r=weihanglo
fix(complete): Harden `--target` completions ### What does this PR try to resolve? I found `--target` wasn't working with rustup as I expected, so this fixes it. We generally only reference rustup if we are running under it but I think in UX code like this, with a fallback scheme, this should be reasonable enough. ### How should we test and review this PR? ### Additional information
This commit is contained in:
commit
eaee77dc15
@ -1121,13 +1121,13 @@ fn get_targets_from_metadata() -> CargoResult<Vec<Target>> {
|
||||
fn get_target_triples() -> Vec<clap_complete::CompletionCandidate> {
|
||||
let mut candidates = Vec::new();
|
||||
|
||||
if is_rustup() {
|
||||
if let Ok(targets) = get_target_triples_from_rustup() {
|
||||
candidates.extend(targets);
|
||||
}
|
||||
} else {
|
||||
if let Ok(targets) = get_target_triples_from_rustup() {
|
||||
candidates = targets;
|
||||
}
|
||||
|
||||
if candidates.is_empty() {
|
||||
if let Ok(targets) = get_target_triples_from_rustc() {
|
||||
candidates.extend(targets);
|
||||
candidates = targets;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user