@@ -1288,7 +1288,9 @@ impl<'test> TestCx<'test> {
1288
1288
// want to actually assert warnings about all this code. Instead
1289
1289
// let's just ignore unused code warnings by defaults and tests
1290
1290
// 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
+ }
1292
1294
}
1293
1295
_ => { }
1294
1296
}
@@ -1582,7 +1584,12 @@ impl<'test> TestCx<'test> {
1582
1584
}
1583
1585
1584
1586
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
+ } ;
1586
1593
rustc. arg ( input_file) . arg ( "-L" ) . arg ( & self . config . build_base ) ;
1587
1594
1588
1595
// Optionally prevent default --target if specified in test compile-flags.
@@ -1605,17 +1612,19 @@ impl<'test> TestCx<'test> {
1605
1612
rustc. args ( & [ "--cfg" , revision] ) ;
1606
1613
}
1607
1614
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
+ }
1616
1624
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
+ }
1619
1628
}
1620
1629
1621
1630
match self . config . mode {
@@ -1668,11 +1677,12 @@ impl<'test> TestCx<'test> {
1668
1677
}
1669
1678
}
1670
1679
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
+ }
1676
1686
}
1677
1687
1678
1688
match output_file {
@@ -1696,8 +1706,10 @@ impl<'test> TestCx<'test> {
1696
1706
} else {
1697
1707
rustc. args ( self . split_maybe_args ( & self . config . target_rustcflags ) ) ;
1698
1708
}
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
+ }
1701
1713
}
1702
1714
1703
1715
rustc. args ( & self . props . compile_flags ) ;
@@ -2509,7 +2521,6 @@ impl<'test> TestCx<'test> {
2509
2521
. compile_flags
2510
2522
. iter ( )
2511
2523
. any ( |s| s. contains ( "--error-format" ) ) ;
2512
-
2513
2524
let proc_res = self . compile_test ( ) ;
2514
2525
self . check_if_test_should_compile ( & proc_res) ;
2515
2526
0 commit comments