@@ -1922,6 +1922,77 @@ impl Step for CrateRustdoc {
19221922 }
19231923}
19241924
1925+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1926+ pub struct CrateRustdocJsonTypes {
1927+ host : TargetSelection ,
1928+ test_kind : TestKind ,
1929+ }
1930+
1931+ impl Step for CrateRustdocJsonTypes {
1932+ type Output = ( ) ;
1933+ const DEFAULT : bool = true ;
1934+ const ONLY_HOSTS : bool = true ;
1935+
1936+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1937+ run. path ( "src/rustdoc-json-types" )
1938+ }
1939+
1940+ fn make_run ( run : RunConfig < ' _ > ) {
1941+ let builder = run. builder ;
1942+
1943+ let test_kind = builder. kind . into ( ) ;
1944+
1945+ builder. ensure ( CrateRustdocJsonTypes { host : run. target , test_kind } ) ;
1946+ }
1947+
1948+ fn run ( self , builder : & Builder < ' _ > ) {
1949+ let test_kind = self . test_kind ;
1950+ let target = self . host ;
1951+
1952+ // Use the previous stage compiler to reuse the artifacts that are
1953+ // created when running compiletest for src/test/rustdoc. If this used
1954+ // `compiler`, then it would cause rustdoc to be built *again*, which
1955+ // isn't really necessary.
1956+ let compiler = builder. compiler_for ( builder. top_stage , target, target) ;
1957+ builder. ensure ( compile:: Rustc { compiler, target } ) ;
1958+
1959+ let mut cargo = tool:: prepare_tool_cargo (
1960+ builder,
1961+ compiler,
1962+ Mode :: ToolRustc ,
1963+ target,
1964+ test_kind. subcommand ( ) ,
1965+ "src/rustdoc-json-types" ,
1966+ SourceType :: InTree ,
1967+ & [ ] ,
1968+ ) ;
1969+ if test_kind. subcommand ( ) == "test" && !builder. fail_fast {
1970+ cargo. arg ( "--no-fail-fast" ) ;
1971+ }
1972+
1973+ cargo. arg ( "-p" ) . arg ( "rustdoc-json-types" ) ;
1974+
1975+ cargo. arg ( "--" ) ;
1976+ cargo. args ( & builder. config . cmd . test_args ( ) ) ;
1977+
1978+ if self . host . contains ( "musl" ) {
1979+ cargo. arg ( "'-Ctarget-feature=-crt-static'" ) ;
1980+ }
1981+
1982+ if !builder. config . verbose_tests {
1983+ cargo. arg ( "--quiet" ) ;
1984+ }
1985+
1986+ builder. info ( & format ! (
1987+ "{} rustdoc-json-types stage{} ({} -> {})" ,
1988+ test_kind, compiler. stage, & compiler. host, target
1989+ ) ) ;
1990+ let _time = util:: timeit ( & builder) ;
1991+
1992+ try_run ( builder, & mut cargo. into ( ) ) ;
1993+ }
1994+ }
1995+
19251996/// Some test suites are run inside emulators or on remote devices, and most
19261997/// of our test binaries are linked dynamically which means we need to ship
19271998/// the standard library and such to the emulator ahead of time. This step
0 commit comments