Suggest use of --print target-list
when target is not found.
If given target could not be found suggest using `--print target-list`. Previously, error has been reported as: $ rustc --target x86-unknown-linux-gnu error: Error loading target specification: Could not find specification for target "x86-unknown-linux-gnu" After changes it looks as follows: rustc --target x86-unknown-linux-gnu error: Error loading target specification: Could not find specification for target "x86-unknown-linux-gnu" help: Use `--print target-list` for a list of built-in targets
This commit is contained in:
parent
2ad98a0b42
commit
443f1ca83c
1 changed files with 5 additions and 2 deletions
|
@ -30,7 +30,7 @@ use syntax::parse;
|
||||||
use syntax::parse::token::InternedString;
|
use syntax::parse::token::InternedString;
|
||||||
use syntax::feature_gate::UnstableFeatures;
|
use syntax::feature_gate::UnstableFeatures;
|
||||||
|
|
||||||
use errors::{ColorConfig, Handler};
|
use errors::{ColorConfig, FatalError, Handler};
|
||||||
|
|
||||||
use getopts;
|
use getopts;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -836,7 +836,10 @@ pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
|
||||||
let target = match Target::search(&opts.target_triple) {
|
let target = match Target::search(&opts.target_triple) {
|
||||||
Ok(t) => t,
|
Ok(t) => t,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
panic!(sp.fatal(&format!("Error loading target specification: {}", e)));
|
sp.struct_fatal(&format!("Error loading target specification: {}", e))
|
||||||
|
.help("Use `--print target-list` for a list of built-in targets")
|
||||||
|
.emit();
|
||||||
|
panic!(FatalError);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue