@@ -263,11 +263,19 @@ impl<'test> TestCx<'test> {
263
263
Ui | MirOpt => false ,
264
264
mode => panic ! ( "unimplemented for mode {:?}" , mode) ,
265
265
} ;
266
- if test_should_run { self . run_if_enabled ( ) } else { WillExecute :: No }
266
+ if test_should_run {
267
+ self . run_if_enabled ( )
268
+ } else {
269
+ WillExecute :: No
270
+ }
267
271
}
268
272
269
273
fn run_if_enabled ( & self ) -> WillExecute {
270
- if self . config . run_enabled ( ) { WillExecute :: Yes } else { WillExecute :: Disabled }
274
+ if self . config . run_enabled ( ) {
275
+ WillExecute :: Yes
276
+ } else {
277
+ WillExecute :: Disabled
278
+ }
271
279
}
272
280
273
281
fn should_run_successfully ( & self , pm : Option < PassMode > ) -> bool {
@@ -661,6 +669,19 @@ impl<'test> TestCx<'test> {
661
669
}
662
670
663
671
fn run_debuginfo_cdb_test_no_opt ( & self ) {
672
+ let exe_file = self . make_exe_name ( ) ;
673
+
674
+ // Existing PDB files are update in-place. When changing the debuginfo
675
+ // the compiler generates for something, this can lead to the situation
676
+ // where both the old and the new version of the debuginfo for the same
677
+ // type is present in the PDB, which is very confusing.
678
+ // Therefore we delete any existing PDB file before compiling the test
679
+ // case.
680
+ let pdb_file = exe_file. with_extension ( ".pdb" ) ;
681
+ if pdb_file. exists ( ) {
682
+ std:: fs:: remove_file ( pdb_file) . unwrap ( ) ;
683
+ }
684
+
664
685
// compile test file (it should have 'compile-flags:-g' in the header)
665
686
let should_run = self . run_if_enabled ( ) ;
666
687
let compile_result = self . compile_test ( should_run, EmitMetadata :: No ) ;
@@ -671,8 +692,6 @@ impl<'test> TestCx<'test> {
671
692
return ;
672
693
}
673
694
674
- let exe_file = self . make_exe_name ( ) ;
675
-
676
695
let prefixes = {
677
696
static PREFIXES : & [ & str ] = & [ "cdb" , "cdbg" ] ;
678
697
// No "native rust support" variation for CDB yet.
@@ -2010,7 +2029,11 @@ impl<'test> TestCx<'test> {
2010
2029
Some ( ref s) => s
2011
2030
. split ( ' ' )
2012
2031
. filter_map ( |s| {
2013
- if s. chars ( ) . all ( |c| c. is_whitespace ( ) ) { None } else { Some ( s. to_owned ( ) ) }
2032
+ if s. chars ( ) . all ( |c| c. is_whitespace ( ) ) {
2033
+ None
2034
+ } else {
2035
+ Some ( s. to_owned ( ) )
2036
+ }
2014
2037
} )
2015
2038
. collect ( ) ,
2016
2039
None => Vec :: new ( ) ,
@@ -2069,7 +2092,11 @@ impl<'test> TestCx<'test> {
2069
2092
/// The revision, ignored for incremental compilation since it wants all revisions in
2070
2093
/// the same directory.
2071
2094
fn safe_revision ( & self ) -> Option < & str > {
2072
- if self . config . mode == Incremental { None } else { self . revision }
2095
+ if self . config . mode == Incremental {
2096
+ None
2097
+ } else {
2098
+ self . revision
2099
+ }
2073
2100
}
2074
2101
2075
2102
/// Gets the absolute path to the directory where all output for the given
@@ -2224,7 +2251,11 @@ impl<'test> TestCx<'test> {
2224
2251
2225
2252
fn charset ( ) -> & ' static str {
2226
2253
// FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset
2227
- if cfg ! ( target_os = "freebsd" ) { "ISO-8859-1" } else { "UTF-8" }
2254
+ if cfg ! ( target_os = "freebsd" ) {
2255
+ "ISO-8859-1"
2256
+ } else {
2257
+ "UTF-8"
2258
+ }
2228
2259
}
2229
2260
2230
2261
fn run_rustdoc_test ( & self ) {
@@ -3014,7 +3045,11 @@ impl<'test> TestCx<'test> {
3014
3045
let ( stderr_kind, stdout_kind) = match output_kind {
3015
3046
TestOutput :: Compile => (
3016
3047
{
3017
- if self . props . stderr_per_bitwidth { & stderr_bits } else { UI_STDERR }
3048
+ if self . props . stderr_per_bitwidth {
3049
+ & stderr_bits
3050
+ } else {
3051
+ UI_STDERR
3052
+ }
3018
3053
} ,
3019
3054
UI_STDOUT ,
3020
3055
) ,
@@ -3711,7 +3746,11 @@ impl<'test> TestCx<'test> {
3711
3746
for output_file in files {
3712
3747
println ! ( "Actual {} saved to {}" , kind, output_file. display( ) ) ;
3713
3748
}
3714
- if self . config . bless { 0 } else { 1 }
3749
+ if self . config . bless {
3750
+ 0
3751
+ } else {
3752
+ 1
3753
+ }
3715
3754
}
3716
3755
3717
3756
fn prune_duplicate_output ( & self , mode : CompareMode , kind : & str , canon_content : & str ) {
0 commit comments