@@ -900,7 +900,6 @@ impl Step for CrateLibrustc {
900
900
}
901
901
}
902
902
903
-
904
903
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
905
904
pub struct Crate {
906
905
compiler : Compiler ,
@@ -1080,6 +1079,74 @@ impl Step for Crate {
1080
1079
}
1081
1080
}
1082
1081
1082
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1083
+ pub struct Rustdoc {
1084
+ host : Interned < String > ,
1085
+ test_kind : TestKind ,
1086
+ }
1087
+
1088
+ impl Step for Rustdoc {
1089
+ type Output = ( ) ;
1090
+ const DEFAULT : bool = true ;
1091
+ const ONLY_HOSTS : bool = true ;
1092
+
1093
+ fn should_run ( run : ShouldRun ) -> ShouldRun {
1094
+ run. path ( "src/librustdoc" ) . path ( "src/tools/rustdoc" )
1095
+ }
1096
+
1097
+ fn make_run ( run : RunConfig ) {
1098
+ let builder = run. builder ;
1099
+
1100
+ let test_kind = if builder. kind == Kind :: Test {
1101
+ TestKind :: Test
1102
+ } else if builder. kind == Kind :: Bench {
1103
+ TestKind :: Bench
1104
+ } else {
1105
+ panic ! ( "unexpected builder.kind in crate: {:?}" , builder. kind) ;
1106
+ } ;
1107
+
1108
+ builder. ensure ( Rustdoc {
1109
+ host : run. host ,
1110
+ test_kind,
1111
+ } ) ;
1112
+ }
1113
+
1114
+ fn run ( self , builder : & Builder ) {
1115
+ let build = builder. build ;
1116
+ let test_kind = self . test_kind ;
1117
+
1118
+ let compiler = builder. compiler ( builder. top_stage , self . host ) ;
1119
+ let target = compiler. host ;
1120
+
1121
+ builder. ensure ( RemoteCopyLibs { compiler, target } ) ;
1122
+
1123
+ let mut cargo = builder. cargo ( compiler, Mode :: Librustc , target, test_kind. subcommand ( ) ) ;
1124
+ compile:: rustc_cargo ( build, & compiler, target, & mut cargo) ;
1125
+ let _folder = build. fold_output ( || {
1126
+ format ! ( "{}_stage{}-rustdoc" , test_kind. subcommand( ) , compiler. stage)
1127
+ } ) ;
1128
+ println ! ( "{} rustdoc stage{} ({} -> {})" , test_kind, compiler. stage,
1129
+ & compiler. host, target) ;
1130
+
1131
+ if test_kind. subcommand ( ) == "test" && !build. fail_fast {
1132
+ cargo. arg ( "--no-fail-fast" ) ;
1133
+ }
1134
+
1135
+ cargo. arg ( "-p" ) . arg ( "rustdoc:0.0.0" ) ;
1136
+
1137
+ cargo. arg ( "--" ) ;
1138
+ cargo. args ( & build. config . cmd . test_args ( ) ) ;
1139
+
1140
+ if build. config . quiet_tests {
1141
+ cargo. arg ( "--quiet" ) ;
1142
+ }
1143
+
1144
+ let _time = util:: timeit ( ) ;
1145
+
1146
+ try_run ( build, & mut cargo) ;
1147
+ }
1148
+ }
1149
+
1083
1150
fn envify ( s : & str ) -> String {
1084
1151
s. chars ( ) . map ( |c| {
1085
1152
match c {
0 commit comments