about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-09-20 06:43:39 +0200
committerGitHub <noreply@github.com>2024-09-20 06:43:39 +0200
commitee2bec0af741eacb63ee77286939f6fc2db24ce3 (patch)
tree3f63010b9525eead6e0b49e9f3b0549102788ff8
parentb963750b6bd3fb9a70c3835e7e8e8b69716576b4 (diff)
parent08453d5ac224a99873fd83d042efbd61aedd5f72 (diff)
downloadrust-ee2bec0af741eacb63ee77286939f6fc2db24ce3.tar.gz
rust-ee2bec0af741eacb63ee77286939f6fc2db24ce3.zip
Rollup merge of #130567 - jieyouxu:tool-docs-compiletest, r=Kobzol
Register tool docs for compiletest

This PR registers tool docs for `src/tools/compiletest`, meaning that

```
$ ./x doc src/tools/compiletest
```

or

```
$ ./x doc compiletest
```

will now generate docs, like for `run-make-support`.

Fixes #130564.
-rw-r--r--src/bootstrap/src/core/build_steps/doc.rs7
-rw-r--r--src/bootstrap/src/core/builder.rs1
-rw-r--r--src/tools/compiletest/src/header.rs12
3 files changed, 14 insertions, 6 deletions
diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
index 3755f4a33cb..979671cfa9d 100644
--- a/src/bootstrap/src/core/build_steps/doc.rs
+++ b/src/bootstrap/src/core/build_steps/doc.rs
@@ -1058,6 +1058,13 @@ tool_doc!(
     is_library = true,
     crates = ["run_make_support"]
 );
+tool_doc!(
+    Compiletest,
+    "src/tools/compiletest",
+    rustc_tool = false,
+    is_library = true,
+    crates = ["compiletest"]
+);
 
 #[derive(Ord, PartialOrd, Debug, Clone, Hash, PartialEq, Eq)]
 pub struct ErrorIndex {
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 003b11ec7cf..2124890b94f 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -945,6 +945,7 @@ impl<'a> Builder<'a> {
                 doc::Releases,
                 doc::RunMakeSupport,
                 doc::BuildHelper,
+                doc::Compiletest,
             ),
             Kind::Dist => describe!(
                 dist::Docs,
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 933913eb47c..93df6aa7255 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -125,7 +125,7 @@ pub struct TestProps {
     // Build documentation for all specified aux-builds as well
     pub build_aux_docs: bool,
     /// Build the documentation for each crate in a unique output directory.
-    /// Uses <root output directory>/docs/<test name>/doc
+    /// Uses `<root output directory>/docs/<test name>/doc`.
     pub unique_doc_out_dir: bool,
     // Flag to force a crate to be built with the host architecture
     pub force_host: bool,
@@ -1304,12 +1304,12 @@ pub fn llvm_has_libzstd(config: &Config) -> bool {
     false
 }
 
-/// Takes a directive of the form "<version1> [- <version2>]",
-/// returns the numeric representation of <version1> and <version2> as
-/// tuple: (<version1> as u32, <version2> as u32)
+/// Takes a directive of the form `"<version1> [- <version2>]"`,
+/// returns the numeric representation of `<version1>` and `<version2>` as
+/// tuple: `(<version1> as u32, <version2> as u32)`.
 ///
-/// If the <version2> part is omitted, the second component of the tuple
-/// is the same as <version1>.
+/// If the `<version2>` part is omitted, the second component of the tuple
+/// is the same as `<version1>`.
 fn extract_version_range<F>(line: &str, parse: F) -> Option<(u32, u32)>
 where
     F: Fn(&str) -> Option<u32>,