diff options
| author | bors <bors@rust-lang.org> | 2021-08-17 04:18:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-08-17 04:18:55 +0000 |
| commit | 3b5df014390dcef66cc35f968fe51e9558e6ca13 (patch) | |
| tree | 642e21f8d8f6da7b692123aeaed9898845cb75e2 | |
| parent | a183141e2d0f0af7f12946ff1a81615fa35e8099 (diff) | |
| parent | 6216b4ece4468b139d6a09d731ff402533f628c3 (diff) | |
| download | rust-3b5df014390dcef66cc35f968fe51e9558e6ca13.tar.gz rust-3b5df014390dcef66cc35f968fe51e9558e6ca13.zip | |
Auto merge of #87119 - jyn514:rustfmt-doc-private, r=Mark-Simulacrum
Document private items for rustfmt This is possible now that https://github.com/rust-lang/rust/pull/73936 has been merged.
| -rw-r--r-- | src/bootstrap/doc.rs | 15 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/comment.rs | 2 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/macros.rs | 2 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/patterns.rs | 4 |
4 files changed, 7 insertions, 16 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 9ec5d4d8ccd..c8714117930 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -619,7 +619,7 @@ impl Step for Rustc { } macro_rules! tool_doc { - ($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?], binary=$bin:expr) => { + ($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(,)?) => { #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct $tool { stage: u32, @@ -688,9 +688,7 @@ macro_rules! tool_doc { cargo.arg("-p").arg($krate); )+ - if !$bin { - cargo.rustdocflag("--document-private-items"); - } + cargo.rustdocflag("--document-private-items"); cargo.rustdocflag("--enable-index-page"); cargo.rustdocflag("--show-type-layout"); cargo.rustdocflag("-Zunstable-options"); @@ -700,19 +698,12 @@ macro_rules! tool_doc { } } -tool_doc!( - Rustdoc, - "rustdoc-tool", - "src/tools/rustdoc", - ["rustdoc", "rustdoc-json-types"], - binary = false -); +tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"]); tool_doc!( Rustfmt, "rustfmt-nightly", "src/tools/rustfmt", ["rustfmt-nightly", "rustfmt-config_proc_macro"], - binary = true ); #[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/src/tools/rustfmt/src/comment.rs b/src/tools/rustfmt/src/comment.rs index 0f8118a408e..58a2b5e6aec 100644 --- a/src/tools/rustfmt/src/comment.rs +++ b/src/tools/rustfmt/src/comment.rs @@ -393,7 +393,7 @@ fn identify_comment( } /// Attributes for code blocks in rustdoc. -/// See https://doc.rust-lang.org/rustdoc/print.html#attributes +/// See <https://doc.rust-lang.org/rustdoc/print.html#attributes>. enum CodeBlockAttribute { Rust, Ignore, diff --git a/src/tools/rustfmt/src/macros.rs b/src/tools/rustfmt/src/macros.rs index 6c5e32716c0..c8ee590b6cc 100644 --- a/src/tools/rustfmt/src/macros.rs +++ b/src/tools/rustfmt/src/macros.rs @@ -1417,7 +1417,7 @@ impl MacroBranch { } } -/// Format `lazy_static!` from https://crates.io/crates/lazy_static. +/// Format `lazy_static!` from <https://crates.io/crates/lazy_static>. /// /// # Expected syntax /// diff --git a/src/tools/rustfmt/src/patterns.rs b/src/tools/rustfmt/src/patterns.rs index 062e9cef9bb..0501e76d277 100644 --- a/src/tools/rustfmt/src/patterns.rs +++ b/src/tools/rustfmt/src/patterns.rs @@ -22,11 +22,11 @@ use crate::utils::{format_mutability, mk_sp, mk_sp_lo_plus_one, rewrite_ident}; /// Returns `true` if the given pattern is "short". /// A short pattern is defined by the following grammar: /// -/// [small, ntp]: +/// `[small, ntp]`: /// - single token /// - `&[single-line, ntp]` /// -/// [small]: +/// `[small]`: /// - `[small, ntp]` /// - unary tuple constructor `([small, ntp])` /// - `&[small]` |
