@@ -44,7 +44,7 @@ pub struct TestOptions {
44
44
pub fn run ( options : Options ) -> i32 {
45
45
let input = config:: Input :: File ( options. input . clone ( ) ) ;
46
46
47
- let mut sessopts = config:: Options {
47
+ let sessopts = config:: Options {
48
48
maybe_sysroot : options. maybe_sysroot . clone ( ) . or_else (
49
49
|| Some ( env:: current_exe ( ) . unwrap ( ) . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( ) . to_path_buf ( ) ) ) ,
50
50
search_paths : options. libs . clone ( ) ,
@@ -60,7 +60,6 @@ pub fn run(options: Options) -> i32 {
60
60
edition : options. edition ,
61
61
..config:: Options :: default ( )
62
62
} ;
63
- options. target . as_ref ( ) . map ( |t| { sessopts. target_triple = t. clone ( ) } ) ;
64
63
let config = interface:: Config {
65
64
opts : sessopts,
66
65
crate_cfg : config:: parse_cfgspecs ( options. cfgs . clone ( ) ) ,
@@ -198,7 +197,7 @@ fn run_test(
198
197
as_test_harness : bool ,
199
198
runtool : Option < String > ,
200
199
runtool_args : Vec < String > ,
201
- target : Option < TargetTriple > ,
200
+ target : TargetTriple ,
202
201
compile_fail : bool ,
203
202
mut error_codes : Vec < String > ,
204
203
opts : & TestOptions ,
@@ -244,7 +243,7 @@ fn run_test(
244
243
..cg
245
244
} ,
246
245
test : as_test_harness,
247
- target_triple : target. unwrap_or ( TargetTriple :: from_triple ( config :: host_triple ( ) ) ) ,
246
+ target_triple : target,
248
247
unstable_features : UnstableFeatures :: from_environment ( ) ,
249
248
debugging_opts : config:: DebuggingOptions {
250
249
..config:: basic_debugging_options ( )
@@ -686,7 +685,7 @@ pub struct Collector {
686
685
persist_doctests : Option < PathBuf > ,
687
686
runtool : Option < String > ,
688
687
runtool_args : Vec < String > ,
689
- target : Option < TargetTriple > ,
688
+ target : TargetTriple ,
690
689
pub enable_per_target_ignores : bool ,
691
690
}
692
691
@@ -696,7 +695,7 @@ impl Collector {
696
695
maybe_sysroot : Option < PathBuf > , source_map : Option < Lrc < SourceMap > > ,
697
696
filename : Option < PathBuf > , linker : Option < PathBuf > , edition : Edition ,
698
697
persist_doctests : Option < PathBuf > , runtool : Option < String > ,
699
- runtool_args : Vec < String > , target : Option < TargetTriple > ,
698
+ runtool_args : Vec < String > , target : TargetTriple ,
700
699
enable_per_target_ignores : bool ) -> Collector {
701
700
Collector {
702
701
tests : Vec :: new ( ) ,
@@ -766,7 +765,7 @@ impl Tester for Collector {
766
765
let runtool = self . runtool . clone ( ) ;
767
766
let runtool_args = self . runtool_args . clone ( ) ;
768
767
let target = self . target . clone ( ) ;
769
- let target_str = target. as_ref ( ) . map ( |t| t . to_string ( ) ) ;
768
+ let target_str = target. to_string ( ) ;
770
769
771
770
debug ! ( "Creating test {}: {}" , name, test) ;
772
771
self . tests . push ( testing:: TestDescAndFn {
@@ -776,8 +775,7 @@ impl Tester for Collector {
776
775
Ignore :: All => true ,
777
776
Ignore :: None => false ,
778
777
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) )
781
779
} ,
782
780
} ,
783
781
// compiler failures are test failures
0 commit comments