@@ -31,21 +31,21 @@ pub trait Environment {
3131 self . build_artifacts ( )
3232 . join ( "stage0" )
3333 . join ( "bin" )
34- . join ( format ! ( "cargo{}" , self . executable_extension( ) ) )
34+ . join ( format ! ( "cargo{}" , executable_extension( ) ) )
3535 }
3636
3737 fn rustc_stage_0 ( & self ) -> Utf8PathBuf {
3838 self . build_artifacts ( )
3939 . join ( "stage0" )
4040 . join ( "bin" )
41- . join ( format ! ( "rustc{}" , self . executable_extension( ) ) )
41+ . join ( format ! ( "rustc{}" , executable_extension( ) ) )
4242 }
4343
4444 fn rustc_stage_2 ( & self ) -> Utf8PathBuf {
4545 self . build_artifacts ( )
4646 . join ( "stage2" )
4747 . join ( "bin" )
48- . join ( format ! ( "rustc{}" , self . executable_extension( ) ) )
48+ . join ( format ! ( "rustc{}" , executable_extension( ) ) )
4949 }
5050
5151 /// Path to the built rustc-perf benchmark suite.
@@ -60,9 +60,6 @@ pub trait Environment {
6060
6161 fn supports_shared_llvm ( & self ) -> bool ;
6262
63- /// What is the extension of binary executables in this environment?
64- fn executable_extension ( & self ) -> & ' static str ;
65-
6663 /// List of test paths that should be skipped when testing the optimized artifacts.
6764 fn skipped_tests ( & self ) -> & ' static [ & ' static str ] ;
6865}
@@ -73,3 +70,14 @@ pub fn create_environment(target_triple: String) -> Box<dyn Environment> {
7370 #[ cfg( target_family = "windows" ) ]
7471 return Box :: new ( windows:: WindowsEnvironment :: new ( target_triple) ) ;
7572}
73+
74+ /// What is the extension of binary executables on this platform?
75+ #[ cfg( target_family = "unix" ) ]
76+ pub fn executable_extension ( ) -> & ' static str {
77+ ""
78+ }
79+
80+ #[ cfg( target_family = "windows" ) ]
81+ pub fn executable_extension ( ) -> & ' static str {
82+ ".exe"
83+ }
0 commit comments