@@ -1288,7 +1288,9 @@ impl<'test> TestCx<'test> {
12881288 // want to actually assert warnings about all this code. Instead
12891289 // let's just ignore unused code warnings by defaults and tests
12901290 // can turn it back on if needed.
1291- rustc. args ( & [ "-A" , "unused" ] ) ;
1291+ if !self . config . src_base . ends_with ( "rustdoc-ui" ) {
1292+ rustc. args ( & [ "-A" , "unused" ] ) ;
1293+ }
12921294 }
12931295 _ => { }
12941296 }
@@ -1582,7 +1584,12 @@ impl<'test> TestCx<'test> {
15821584 }
15831585
15841586 fn make_compile_args ( & self , input_file : & Path , output_file : TargetLocation ) -> Command {
1585- let mut rustc = Command :: new ( & self . config . rustc_path ) ;
1587+ let is_rustdoc = self . config . src_base . ends_with ( "rustdoc-ui" ) ;
1588+ let mut rustc = if !is_rustdoc {
1589+ Command :: new ( & self . config . rustc_path )
1590+ } else {
1591+ Command :: new ( & self . config . rustdoc_path . clone ( ) . expect ( "no rustdoc built yet" ) )
1592+ } ;
15861593 rustc. arg ( input_file) . arg ( "-L" ) . arg ( & self . config . build_base ) ;
15871594
15881595 // Optionally prevent default --target if specified in test compile-flags.
@@ -1605,17 +1612,19 @@ impl<'test> TestCx<'test> {
16051612 rustc. args ( & [ "--cfg" , revision] ) ;
16061613 }
16071614
1608- if let Some ( ref incremental_dir) = self . props . incremental_dir {
1609- rustc. args ( & [
1610- "-C" ,
1611- & format ! ( "incremental={}" , incremental_dir. display( ) ) ,
1612- ] ) ;
1613- rustc. args ( & [ "-Z" , "incremental-verify-ich" ] ) ;
1614- rustc. args ( & [ "-Z" , "incremental-queries" ] ) ;
1615- }
1615+ if !is_rustdoc {
1616+ if let Some ( ref incremental_dir) = self . props . incremental_dir {
1617+ rustc. args ( & [
1618+ "-C" ,
1619+ & format ! ( "incremental={}" , incremental_dir. display( ) ) ,
1620+ ] ) ;
1621+ rustc. args ( & [ "-Z" , "incremental-verify-ich" ] ) ;
1622+ rustc. args ( & [ "-Z" , "incremental-queries" ] ) ;
1623+ }
16161624
1617- if self . config . mode == CodegenUnits {
1618- rustc. args ( & [ "-Z" , "human_readable_cgu_names" ] ) ;
1625+ if self . config . mode == CodegenUnits {
1626+ rustc. args ( & [ "-Z" , "human_readable_cgu_names" ] ) ;
1627+ }
16191628 }
16201629
16211630 match self . config . mode {
@@ -1668,11 +1677,12 @@ impl<'test> TestCx<'test> {
16681677 }
16691678 }
16701679
1671-
1672- if self . config . target == "wasm32-unknown-unknown" {
1673- // rustc.arg("-g"); // get any backtrace at all on errors
1674- } else if !self . props . no_prefer_dynamic {
1675- rustc. args ( & [ "-C" , "prefer-dynamic" ] ) ;
1680+ if !is_rustdoc {
1681+ if self . config . target == "wasm32-unknown-unknown" {
1682+ // rustc.arg("-g"); // get any backtrace at all on errors
1683+ } else if !self . props . no_prefer_dynamic {
1684+ rustc. args ( & [ "-C" , "prefer-dynamic" ] ) ;
1685+ }
16761686 }
16771687
16781688 match output_file {
@@ -1696,8 +1706,10 @@ impl<'test> TestCx<'test> {
16961706 } else {
16971707 rustc. args ( self . split_maybe_args ( & self . config . target_rustcflags ) ) ;
16981708 }
1699- if let Some ( ref linker) = self . config . linker {
1700- rustc. arg ( format ! ( "-Clinker={}" , linker) ) ;
1709+ if !is_rustdoc {
1710+ if let Some ( ref linker) = self . config . linker {
1711+ rustc. arg ( format ! ( "-Clinker={}" , linker) ) ;
1712+ }
17011713 }
17021714
17031715 rustc. args ( & self . props . compile_flags ) ;
@@ -2509,7 +2521,6 @@ impl<'test> TestCx<'test> {
25092521 . compile_flags
25102522 . iter ( )
25112523 . any ( |s| s. contains ( "--error-format" ) ) ;
2512-
25132524 let proc_res = self . compile_test ( ) ;
25142525 self . check_if_test_should_compile ( & proc_res) ;
25152526
0 commit comments