@@ -44,7 +44,7 @@ pub struct TestOptions {
4444pub fn run ( options : Options ) -> i32 {
4545 let input = config:: Input :: File ( options. input . clone ( ) ) ;
4646
47- let mut sessopts = config:: Options {
47+ let sessopts = config:: Options {
4848 maybe_sysroot : options. maybe_sysroot . clone ( ) . or_else (
4949 || Some ( env:: current_exe ( ) . unwrap ( ) . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( ) . to_path_buf ( ) ) ) ,
5050 search_paths : options. libs . clone ( ) ,
@@ -60,7 +60,6 @@ pub fn run(options: Options) -> i32 {
6060 edition : options. edition ,
6161 ..config:: Options :: default ( )
6262 } ;
63- options. target . as_ref ( ) . map ( |t| { sessopts. target_triple = t. clone ( ) } ) ;
6463 let config = interface:: Config {
6564 opts : sessopts,
6665 crate_cfg : config:: parse_cfgspecs ( options. cfgs . clone ( ) ) ,
@@ -198,7 +197,7 @@ fn run_test(
198197 as_test_harness : bool ,
199198 runtool : Option < String > ,
200199 runtool_args : Vec < String > ,
201- target : Option < TargetTriple > ,
200+ target : TargetTriple ,
202201 compile_fail : bool ,
203202 mut error_codes : Vec < String > ,
204203 opts : & TestOptions ,
@@ -244,7 +243,7 @@ fn run_test(
244243 ..cg
245244 } ,
246245 test : as_test_harness,
247- target_triple : target. unwrap_or ( TargetTriple :: from_triple ( config :: host_triple ( ) ) ) ,
246+ target_triple : target,
248247 unstable_features : UnstableFeatures :: from_environment ( ) ,
249248 debugging_opts : config:: DebuggingOptions {
250249 ..config:: basic_debugging_options ( )
@@ -686,7 +685,7 @@ pub struct Collector {
686685 persist_doctests : Option < PathBuf > ,
687686 runtool : Option < String > ,
688687 runtool_args : Vec < String > ,
689- target : Option < TargetTriple > ,
688+ target : TargetTriple ,
690689 pub enable_per_target_ignores : bool ,
691690}
692691
@@ -696,7 +695,7 @@ impl Collector {
696695 maybe_sysroot : Option < PathBuf > , source_map : Option < Lrc < SourceMap > > ,
697696 filename : Option < PathBuf > , linker : Option < PathBuf > , edition : Edition ,
698697 persist_doctests : Option < PathBuf > , runtool : Option < String > ,
699- runtool_args : Vec < String > , target : Option < TargetTriple > ,
698+ runtool_args : Vec < String > , target : TargetTriple ,
700699 enable_per_target_ignores : bool ) -> Collector {
701700 Collector {
702701 tests : Vec :: new ( ) ,
@@ -766,7 +765,7 @@ impl Tester for Collector {
766765 let runtool = self . runtool . clone ( ) ;
767766 let runtool_args = self . runtool_args . clone ( ) ;
768767 let target = self . target . clone ( ) ;
769- let target_str = target. as_ref ( ) . map ( |t| t . to_string ( ) ) ;
768+ let target_str = target. to_string ( ) ;
770769
771770 debug ! ( "Creating test {}: {}" , name, test) ;
772771 self . tests . push ( testing:: TestDescAndFn {
@@ -776,8 +775,7 @@ impl Tester for Collector {
776775 Ignore :: All => true ,
777776 Ignore :: None => false ,
778777 Ignore :: Some ( ref ignores) => {
779- target_str. map_or ( false ,
780- |s| ignores. iter ( ) . any ( |t| s. contains ( t) ) )
778+ ignores. iter ( ) . any ( |s| target_str. contains ( s) )
781779 } ,
782780 } ,
783781 // compiler failures are test failures
0 commit comments