Skip to content

Commit 55f01af

Browse files
Generate unstable docs with items under feature
Add the items to the autogenerated stubs Make unstable-book-gen use the top stage instead of stage 0 Generate the full docs, only print and save optional notes
1 parent c4e0cd9 commit 55f01af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+203
-209
lines changed

Cargo.lock

+3
Original file line numberDiff line numberDiff line change
@@ -6045,6 +6045,9 @@ name = "unstable-book-gen"
60456045
version = "0.1.0"
60466046
dependencies = [
60476047
"num-traits",
6048+
"rustdoc-json-types",
6049+
"serde_json",
6050+
"syn",
60486051
"tidy",
60496052
]
60506053

src/bootstrap/builder/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ mod dist {
286286
// Make sure rustdoc is only built once.
287287
assert_eq!(
288288
first(cache.all::<tool::Rustdoc>()),
289-
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
289+
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }]
290290
);
291291
}
292292

@@ -608,7 +608,7 @@ mod dist {
608608
// stage minus 1 if --stage is not 0. Very confusing!
609609
assert_eq!(
610610
first(builder.cache.all::<tool::Rustdoc>()),
611-
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
611+
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }]
612612
);
613613
}
614614

src/bootstrap/doc.rs

+8
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,13 @@ impl Step for UnstableBookGen {
931931

932932
fn run(self, builder: &Builder<'_>) {
933933
let target = self.target;
934+
let host = builder.build.build;
935+
936+
builder.ensure(Std {
937+
stage: builder.top_stage,
938+
target: host,
939+
format: DocumentationFormat::JSON,
940+
});
934941

935942
builder.info(&format!("Generating unstable book md files ({})", target));
936943
let out = builder.md_doc_out(target).join("unstable-book");
@@ -940,6 +947,7 @@ impl Step for UnstableBookGen {
940947
cmd.arg(builder.src.join("library"));
941948
cmd.arg(builder.src.join("compiler"));
942949
cmd.arg(builder.src.join("src"));
950+
cmd.arg(builder.json_doc_out(host));
943951
cmd.arg(out);
944952

945953
builder.run(&mut cmd);

src/doc/unstable-book/src/library-features/allocator-api.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# `allocator_api`
2-
3-
The tracking issue for this feature is [#32838]
4-
5-
[#32838]: https://github.com/rust-lang/rust/issues/32838
6-
7-
------------------------
8-
91
Sometimes you want the memory for one collection to use a different
102
allocator than the memory for another collection. In this case,
113
replacing the global allocator is not a workable option. Instead,

src/doc/unstable-book/src/library-features/c-variadic.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# `c_variadic`
2-
3-
The tracking issue for this feature is: [#44930]
4-
5-
[#44930]: https://github.com/rust-lang/rust/issues/44930
6-
7-
------------------------
8-
91
The `c_variadic` library feature exposes the `VaList` structure,
102
Rust's analogue of C's `va_list` type.
113

src/doc/unstable-book/src/library-features/c-void-variant.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/concat-idents.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# `concat_idents`
2-
3-
The tracking issue for this feature is: [#29599]
4-
5-
[#29599]: https://github.com/rust-lang/rust/issues/29599
6-
7-
------------------------
8-
91
The `concat_idents` feature adds a macro for concatenating multiple identifiers
102
into one identifier.
113

src/doc/unstable-book/src/library-features/core-intrinsics.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/core-panic.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/core-private-bignum.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/core-private-diy-float.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/dec2flt.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/default-free-fn.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# `default_free_fn`
2-
3-
The tracking issue for this feature is: [#73014]
4-
5-
[#73014]: https://github.com/rust-lang/rust/issues/73014
6-
7-
------------------------
8-
91
Adds a free `default()` function to the `std::default` module. This function
102
just forwards to [`Default::default()`], but may remove repetition of the word
113
"default" from the call site.

src/doc/unstable-book/src/library-features/derive-clone-copy.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/derive-eq.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/fd-read.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/fd.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/flt2dec.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/fmt-internals.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/fn-traits.md

-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# `fn_traits`
2-
3-
The tracking issue for this feature is [#29625]
4-
5-
See Also: [`unboxed_closures`](../language-features/unboxed-closures.md)
6-
7-
[#29625]: https://github.com/rust-lang/rust/issues/29625
8-
9-
----
10-
111
The `fn_traits` feature allows for implementation of the [`Fn*`] traits
122
for creating custom closure-like types.
133

src/doc/unstable-book/src/library-features/internal-output-capture.md

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# `is_sorted`
2-
3-
The tracking issue for this feature is: [#53485]
4-
5-
[#53485]: https://github.com/rust-lang/rust/issues/53485
6-
7-
------------------------
8-
91
Add the methods `is_sorted`, `is_sorted_by` and `is_sorted_by_key` to `[T]`;
102
add the methods `is_sorted`, `is_sorted_by` and `is_sorted_by_key` to
113
`Iterator`.

src/doc/unstable-book/src/library-features/libstd-sys-internals.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/libstd-thread-internals.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/print-internals.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/profiler-runtime-lib.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/rt.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/sort-internals.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/str-internals.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/test.md

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# `test`
2-
3-
The tracking issue for this feature is: None.
4-
5-
------------------------
6-
71
The internals of the `test` crate are unstable, behind the `test` flag. The
82
most widely used part of the `test` crate are benchmark tests, which can test
93
the performance of your code. Let's make our `src/lib.rs` look like this

src/doc/unstable-book/src/library-features/thread-local-internals.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/trace-macros.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# `trace_macros`
2-
3-
The tracking issue for this feature is [#29598].
4-
5-
[#29598]: https://github.com/rust-lang/rust/issues/29598
6-
7-
------------------------
8-
91
With `trace_macros` you can trace the expansion of macros in your code.
102

113
## Examples

src/doc/unstable-book/src/library-features/update-panic-count.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/windows-c.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/windows-handle.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/windows-net.md

-5
This file was deleted.

src/doc/unstable-book/src/library-features/windows-stdio.md

-5
This file was deleted.

src/tools/unstable-book-gen/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ edition = "2021"
77
[dependencies]
88
tidy = { path = "../tidy" }
99

10+
11+
serde_json = "1"
12+
rustdoc-json-types = { path = "../../rustdoc-json-types" }
13+
syn = { version = "1", features = ["full"] }
14+
1015
# not actually needed but required for now to unify the feature selection of
1116
# `num-traits` between this and `rustbook`
1217
num-traits = "0.2"
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `{name}`
2+
3+
The tracking issue for this feature is: [#{issue}]
4+
{items}
5+
[#{issue}]: https://github.com/rust-lang/rust/issues/{issue}
6+
7+
------------------------
8+
9+
{notes}

0 commit comments

Comments
 (0)