@@ -643,7 +643,7 @@ impl Step for Rustc {
643
643
}
644
644
645
645
macro_rules! tool_doc {
646
- ( $tool: ident, $should_run: literal, $path: literal, [ $( $krate: literal) ,+ $( , ) ?] $( , ) ?) => {
646
+ ( $tool: ident, $should_run: literal, $path: literal, [ $( $krate: literal) ,+ $( , ) ?] , in_tree = $in_tree : expr $( , ) ?) => {
647
647
#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
648
648
pub struct $tool {
649
649
target: TargetSelection ,
@@ -699,6 +699,12 @@ macro_rules! tool_doc {
699
699
t!( fs:: create_dir_all( & out_dir) ) ;
700
700
t!( symlink_dir_force( & builder. config, & out, & out_dir) ) ;
701
701
702
+ let source_type = if $in_tree == true {
703
+ SourceType :: InTree
704
+ } else {
705
+ SourceType :: Submodule
706
+ } ;
707
+
702
708
// Build cargo command.
703
709
let mut cargo = prepare_tool_cargo(
704
710
builder,
@@ -707,7 +713,7 @@ macro_rules! tool_doc {
707
713
target,
708
714
"doc" ,
709
715
$path,
710
- SourceType :: InTree ,
716
+ source_type ,
711
717
& [ ] ,
712
718
) ;
713
719
@@ -729,15 +735,22 @@ macro_rules! tool_doc {
729
735
}
730
736
}
731
737
732
- tool_doc ! ( Rustdoc , "rustdoc-tool" , "src/tools/rustdoc" , [ "rustdoc" , "rustdoc-json-types" ] ) ;
738
+ tool_doc ! (
739
+ Rustdoc ,
740
+ "rustdoc-tool" ,
741
+ "src/tools/rustdoc" ,
742
+ [ "rustdoc" , "rustdoc-json-types" ] ,
743
+ in_tree = true
744
+ ) ;
733
745
tool_doc ! (
734
746
Rustfmt ,
735
747
"rustfmt-nightly" ,
736
748
"src/tools/rustfmt" ,
737
749
[ "rustfmt-nightly" , "rustfmt-config_proc_macro" ] ,
750
+ in_tree = true
738
751
) ;
739
- tool_doc ! ( Clippy , "clippy" , "src/tools/clippy" , [ "clippy_utils" ] ) ;
740
- tool_doc ! ( Miri , "miri" , "src/tools/miri" , [ "miri" ] ) ;
752
+ tool_doc ! ( Clippy , "clippy" , "src/tools/clippy" , [ "clippy_utils" ] , in_tree = true ) ;
753
+ tool_doc ! ( Miri , "miri" , "src/tools/miri" , [ "miri" ] , in_tree = false ) ;
741
754
742
755
#[ derive( Ord , PartialOrd , Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
743
756
pub struct ErrorIndex {
0 commit comments