Skip to content

Commit 01cf0bd

Browse files
committed
Document rustfmt on nightly-rustc
The recursion_limit attribute avoids the following error: ``` error[E0275]: overflow evaluating the requirement `std::ptr::Unique<rustc_ast::Pat>: std::marker::Send` | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustfmt_nightly`) ```
1 parent 81f3ab6 commit 01cf0bd

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Diff for: src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ impl<'a> Builder<'a> {
465465
doc::Std,
466466
doc::Rustc,
467467
doc::Rustdoc,
468-
// doc::Rustfmt,
468+
doc::Rustfmt,
469469
doc::ErrorIndex,
470470
doc::Nomicon,
471471
doc::Reference,

Diff for: src/bootstrap/doc.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ impl Step for Rustc {
594594
}
595595

596596
macro_rules! tool_doc {
597-
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?]) => {
597+
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(, binary=$bin:expr)?) => {
598598
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
599599
pub struct $tool {
600600
stage: u32,
@@ -639,9 +639,6 @@ macro_rules! tool_doc {
639639
// Build rustc docs so that we generate relative links.
640640
builder.ensure(Rustc { stage, target });
641641

642-
// Build the tool.
643-
builder.ensure(tool::$tool { compiler });
644-
645642
// Symlink compiler docs to the output directory of rustdoc documentation.
646643
let out_dir = builder.stage_out(compiler, Mode::ToolRustc).join(target.triple).join("doc");
647644
t!(fs::create_dir_all(&out_dir));
@@ -666,7 +663,9 @@ macro_rules! tool_doc {
666663
cargo.arg("-p").arg($krate);
667664
)+
668665

669-
cargo.rustdocflag("--document-private-items");
666+
$(if !$bin {
667+
cargo.rustdocflag("--document-private-items");
668+
})?
670669
cargo.rustdocflag("--enable-index-page");
671670
cargo.rustdocflag("--show-type-layout");
672671
cargo.rustdocflag("-Zunstable-options");
@@ -677,6 +676,13 @@ macro_rules! tool_doc {
677676
}
678677

679678
tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"]);
679+
tool_doc!(
680+
Rustfmt,
681+
"rustfmt-nightly",
682+
"src/tools/rustfmt",
683+
["rustfmt-nightly", "rustfmt-config_proc_macro"],
684+
binary = true
685+
);
680686

681687
#[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)]
682688
pub struct ErrorIndex {

Diff for: src/tools/rustfmt/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![feature(rustc_private)]
22
#![deny(rust_2018_idioms)]
33
#![warn(unreachable_pub)]
4+
#![recursion_limit = "256"]
45

56
#[macro_use]
67
extern crate derive_new;

0 commit comments

Comments
 (0)