@@ -26,6 +26,7 @@ use util::{exe, libdir, add_lib_path};
26
26
use { Build , Mode } ;
27
27
use cache:: { INTERNER , Interned , Cache } ;
28
28
use check;
29
+ use test;
29
30
use flags:: Subcommand ;
30
31
use doc;
31
32
use tool;
@@ -230,6 +231,7 @@ impl<'a> ShouldRun<'a> {
230
231
#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
231
232
pub enum Kind {
232
233
Build ,
234
+ Check ,
233
235
Test ,
234
236
Bench ,
235
237
Dist ,
@@ -251,13 +253,13 @@ impl<'a> Builder<'a> {
251
253
tool:: Compiletest , tool:: RemoteTestServer , tool:: RemoteTestClient ,
252
254
tool:: RustInstaller , tool:: Cargo , tool:: Rls , tool:: Rustdoc , tool:: Clippy ,
253
255
native:: Llvm , tool:: Rustfmt , tool:: Miri ) ,
254
- Kind :: Test => describe ! ( check:: Tidy , check:: Bootstrap , check:: DefaultCompiletest ,
255
- check :: HostCompiletest , check :: Crate , check :: CrateLibrustc , check :: Rustdoc ,
256
- check :: Linkcheck , check :: Cargotest , check :: Cargo , check :: Rls , check :: Docs ,
257
- check :: ErrorIndex , check :: Distcheck , check :: Rustfmt , check :: Miri , check :: Clippy ,
258
- check :: RustdocJS ) ,
259
-
260
- Kind :: Bench => describe ! ( check :: Crate , check :: CrateLibrustc ) ,
256
+ Kind :: Check => describe ! ( check:: Std , check:: Test , check:: Rustc ) ,
257
+ Kind :: Test => describe ! ( test :: Tidy , test :: Bootstrap , test :: DefaultCompiletest ,
258
+ test :: HostCompiletest , test :: Crate , test :: CrateLibrustc , test :: Rustdoc ,
259
+ test :: Linkcheck , test :: Cargotest , test :: Cargo , test :: Rls , test :: Docs ,
260
+ test :: ErrorIndex , test :: Distcheck , test :: Rustfmt , test :: Miri , test :: Clippy ,
261
+ test :: RustdocJS ) ,
262
+ Kind :: Bench => describe ! ( test :: Crate , test :: CrateLibrustc ) ,
261
263
Kind :: Doc => describe ! ( doc:: UnstableBook , doc:: UnstableBookGen , doc:: TheBook ,
262
264
doc:: Standalone , doc:: Std , doc:: Test , doc:: Rustc , doc:: ErrorIndex , doc:: Nomicon ,
263
265
doc:: Reference , doc:: Rustdoc , doc:: RustByExample , doc:: CargoBook ) ,
@@ -304,6 +306,7 @@ impl<'a> Builder<'a> {
304
306
pub fn run ( build : & Build ) {
305
307
let ( kind, paths) = match build. config . cmd {
306
308
Subcommand :: Build { ref paths } => ( Kind :: Build , & paths[ ..] ) ,
309
+ Subcommand :: Check { ref paths } => ( Kind :: Check , & paths[ ..] ) ,
307
310
Subcommand :: Doc { ref paths } => ( Kind :: Doc , & paths[ ..] ) ,
308
311
Subcommand :: Test { ref paths, .. } => ( Kind :: Test , & paths[ ..] ) ,
309
312
Subcommand :: Bench { ref paths, .. } => ( Kind :: Bench , & paths[ ..] ) ,
@@ -493,13 +496,14 @@ impl<'a> Builder<'a> {
493
496
cargo. env ( "RUSTC_CODEGEN_UNITS" , n. to_string ( ) ) ;
494
497
}
495
498
499
+
496
500
if let Some ( host_linker) = self . build . linker ( compiler. host ) {
497
501
cargo. env ( "RUSTC_HOST_LINKER" , host_linker) ;
498
502
}
499
503
if let Some ( target_linker) = self . build . linker ( target) {
500
504
cargo. env ( "RUSTC_TARGET_LINKER" , target_linker) ;
501
505
}
502
- if cmd != "build" {
506
+ if cmd != "build" && cmd != "check" {
503
507
cargo. env ( "RUSTDOC_LIBDIR" , self . rustc_libdir ( self . compiler ( 2 , self . build . build ) ) ) ;
504
508
}
505
509
@@ -566,8 +570,7 @@ impl<'a> Builder<'a> {
566
570
// not guaranteeing correctness across builds if the compiler
567
571
// is changing under your feet.`
568
572
if self . config . incremental && compiler. stage == 0 {
569
- let incr_dir = self . incremental_dir ( compiler) ;
570
- cargo. env ( "RUSTC_INCREMENTAL" , incr_dir) ;
573
+ cargo. env ( "CARGO_INCREMENTAL" , "1" ) ;
571
574
}
572
575
573
576
if let Some ( ref on_fail) = self . config . on_fail {
0 commit comments