Skip to content

Commit

Permalink
Rollup merge of #130567 - jieyouxu:tool-docs-compiletest, r=Kobzol
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr authored Sep 20, 2024
2 parents b963750 + 08453d5 commit ee2bec0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ impl<'a> Builder<'a> {
doc::Releases,
doc::RunMakeSupport,
doc::BuildHelper,
doc::Compiletest,
),
Kind::Dist => describe!(
dist::Docs,
Expand Down
12 changes: 6 additions & 6 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>,
Expand Down

0 comments on commit ee2bec0

Please sign in to comment.