Skip to content

Commit 0dfc121

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 93e62a2 commit 0dfc121

Some content is hidden

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

41 files changed

+203
-196
lines changed

Cargo.lock

+3
Original file line numberDiff line numberDiff line change
@@ -5906,6 +5906,9 @@ name = "unstable-book-gen"
59065906
version = "0.1.0"
59075907
dependencies = [
59085908
"num-traits",
5909+
"rustdoc-json-types",
5910+
"serde_json",
5911+
"syn",
59095912
"tidy",
59105913
]
59115914

src/bootstrap/src/core/build_steps/doc.rs

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

966966
fn run(self, builder: &Builder<'_>) {
967967
let target = self.target;
968+
let host = builder.build.build;
969+
970+
builder.ensure(Std {
971+
stage: builder.top_stage,
972+
target: host,
973+
format: DocumentationFormat::JSON,
974+
});
968975

969976
builder.info(&format!("Generating unstable book md files ({target})"));
970977
let out = builder.md_doc_out(target).join("unstable-book");
@@ -974,6 +981,7 @@ impl Step for UnstableBookGen {
974981
cmd.arg(builder.src.join("library"));
975982
cmd.arg(builder.src.join("compiler"));
976983
cmd.arg(builder.src.join("src"));
984+
cmd.arg(builder.json_doc_out(host));
977985
cmd.arg(out);
978986

979987
builder.run(&mut cmd);

src/bootstrap/src/tests/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ mod dist {
312312
// Make sure rustdoc is only built once.
313313
assert_eq!(
314314
first(cache.all::<tool::Rustdoc>()),
315-
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
315+
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }]
316316
);
317317
}
318318

@@ -636,7 +636,7 @@ mod dist {
636636
// stage minus 1 if --stage is not 0. Very confusing!
637637
assert_eq!(
638638
first(builder.cache.all::<tool::Rustdoc>()),
639-
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
639+
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }]
640640
);
641641
}
642642

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/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/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)