Skip to content

Commit 6216b4e

Browse files
committed
Document private items for rustfmt
This is possible now that rustdoc allows passing `--document-private-items` more than once.
1 parent 2bd17c1 commit 6216b4e

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

src/bootstrap/doc.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ impl Step for Rustc {
619619
}
620620

621621
macro_rules! tool_doc {
622-
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?], binary=$bin:expr) => {
622+
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(,)?) => {
623623
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
624624
pub struct $tool {
625625
stage: u32,
@@ -688,9 +688,7 @@ macro_rules! tool_doc {
688688
cargo.arg("-p").arg($krate);
689689
)+
690690

691-
if !$bin {
692-
cargo.rustdocflag("--document-private-items");
693-
}
691+
cargo.rustdocflag("--document-private-items");
694692
cargo.rustdocflag("--enable-index-page");
695693
cargo.rustdocflag("--show-type-layout");
696694
cargo.rustdocflag("-Zunstable-options");
@@ -700,19 +698,12 @@ macro_rules! tool_doc {
700698
}
701699
}
702700

703-
tool_doc!(
704-
Rustdoc,
705-
"rustdoc-tool",
706-
"src/tools/rustdoc",
707-
["rustdoc", "rustdoc-json-types"],
708-
binary = false
709-
);
701+
tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"]);
710702
tool_doc!(
711703
Rustfmt,
712704
"rustfmt-nightly",
713705
"src/tools/rustfmt",
714706
["rustfmt-nightly", "rustfmt-config_proc_macro"],
715-
binary = true
716707
);
717708

718709
#[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)]

src/tools/rustfmt/src/comment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ fn identify_comment(
393393
}
394394

395395
/// Attributes for code blocks in rustdoc.
396-
/// See https://doc.rust-lang.org/rustdoc/print.html#attributes
396+
/// See <https://doc.rust-lang.org/rustdoc/print.html#attributes>.
397397
enum CodeBlockAttribute {
398398
Rust,
399399
Ignore,

src/tools/rustfmt/src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ impl MacroBranch {
14171417
}
14181418
}
14191419

1420-
/// Format `lazy_static!` from https://crates.io/crates/lazy_static.
1420+
/// Format `lazy_static!` from <https://crates.io/crates/lazy_static>.
14211421
///
14221422
/// # Expected syntax
14231423
///

src/tools/rustfmt/src/patterns.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ use crate::utils::{format_mutability, mk_sp, mk_sp_lo_plus_one, rewrite_ident};
2222
/// Returns `true` if the given pattern is "short".
2323
/// A short pattern is defined by the following grammar:
2424
///
25-
/// [small, ntp]:
25+
/// `[small, ntp]`:
2626
/// - single token
2727
/// - `&[single-line, ntp]`
2828
///
29-
/// [small]:
29+
/// `[small]`:
3030
/// - `[small, ntp]`
3131
/// - unary tuple constructor `([small, ntp])`
3232
/// - `&[small]`

0 commit comments

Comments
 (0)