@@ -9,7 +9,7 @@ use rustc::session;
9
9
use rustc:: session:: config:: { CrateType , parse_crate_types_from_list} ;
10
10
use rustc:: session:: config:: { CodegenOptions , DebuggingOptions , ErrorOutputType , Externs } ;
11
11
use rustc:: session:: config:: { nightly_options, build_codegen_options, build_debugging_options,
12
- get_cmd_lint_options, ExternEntry } ;
12
+ get_cmd_lint_options, host_triple , ExternEntry } ;
13
13
use rustc:: session:: search_paths:: SearchPath ;
14
14
use rustc_driver;
15
15
use rustc_target:: spec:: TargetTriple ;
@@ -54,7 +54,7 @@ pub struct Options {
54
54
/// Debugging (`-Z`) options to pass to the compiler.
55
55
pub debugging_options : DebuggingOptions ,
56
56
/// The target used to compile the crate against.
57
- pub target : Option < TargetTriple > ,
57
+ pub target : TargetTriple ,
58
58
/// Edition used when reading the crate. Defaults to "2015". Also used by default when
59
59
/// compiling doctests from the crate.
60
60
pub edition : Edition ,
@@ -425,7 +425,9 @@ impl Options {
425
425
}
426
426
}
427
427
428
- let target = matches. opt_str ( "target" ) . map ( |target| {
428
+ let target = matches. opt_str ( "target" ) . map_or (
429
+ TargetTriple :: from_triple ( host_triple ( ) ) ,
430
+ |target| {
429
431
if target. ends_with ( ".json" ) {
430
432
TargetTriple :: TargetPath ( PathBuf :: from ( target) )
431
433
} else {
0 commit comments