@@ -9,7 +9,7 @@ use rustc::session;
99use rustc:: session:: config:: { CrateType , parse_crate_types_from_list} ;
1010use rustc:: session:: config:: { CodegenOptions , DebuggingOptions , ErrorOutputType , Externs } ;
1111use 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 } ;
1313use rustc:: session:: search_paths:: SearchPath ;
1414use rustc_driver;
1515use rustc_target:: spec:: TargetTriple ;
@@ -54,7 +54,7 @@ pub struct Options {
5454 /// Debugging (`-Z`) options to pass to the compiler.
5555 pub debugging_options : DebuggingOptions ,
5656 /// The target used to compile the crate against.
57- pub target : Option < TargetTriple > ,
57+ pub target : TargetTriple ,
5858 /// Edition used when reading the crate. Defaults to "2015". Also used by default when
5959 /// compiling doctests from the crate.
6060 pub edition : Edition ,
@@ -425,7 +425,9 @@ impl Options {
425425 }
426426 }
427427
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| {
429431 if target. ends_with ( ".json" ) {
430432 TargetTriple :: TargetPath ( PathBuf :: from ( target) )
431433 } else {
0 commit comments