Skip to content

Commit 04538c6

Browse files
committed
Update mdbook, cargo, books
This updates the last of the books using mdbook 0.1, finally removing it from the build.
1 parent 2eb0bc5 commit 04538c6

File tree

13 files changed

+83
-349
lines changed

13 files changed

+83
-349
lines changed

Cargo.lock

Lines changed: 47 additions & 246 deletions
Large diffs are not rendered by default.

src/bootstrap/doc.rs

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::cache::{INTERNER, Interned};
2323
use crate::config::Config;
2424

2525
macro_rules! book {
26-
($($name:ident, $path:expr, $book_name:expr, $book_ver:expr;)+) => {
26+
($($name:ident, $path:expr, $book_name:expr;)+) => {
2727
$(
2828
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2929
pub struct $name {
@@ -49,7 +49,6 @@ macro_rules! book {
4949
builder.ensure(RustbookSrc {
5050
target: self.target,
5151
name: INTERNER.intern_str($book_name),
52-
version: $book_ver,
5352
src: doc_src(builder),
5453
})
5554
}
@@ -61,21 +60,15 @@ macro_rules! book {
6160
// NOTE: When adding a book here, make sure to ALSO build the book by
6261
// adding a build step in `src/bootstrap/builder.rs`!
6362
book!(
64-
EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::Latest;
65-
EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::Latest;
66-
Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::Latest;
67-
Reference, "src/doc/reference", "reference", RustbookVersion::MdBook1;
68-
RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::Latest;
69-
RustcBook, "src/doc/rustc", "rustc", RustbookVersion::MdBook1;
70-
RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::Latest;
63+
EditionGuide, "src/doc/edition-guide", "edition-guide";
64+
EmbeddedBook, "src/doc/embedded-book", "embedded-book";
65+
Nomicon, "src/doc/nomicon", "nomicon";
66+
Reference, "src/doc/reference", "reference";
67+
RustByExample, "src/doc/rust-by-example", "rust-by-example";
68+
RustcBook, "src/doc/rustc", "rustc";
69+
RustdocBook, "src/doc/rustdoc", "rustdoc";
7170
);
7271

73-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
74-
enum RustbookVersion {
75-
MdBook1,
76-
Latest,
77-
}
78-
7972
fn doc_src(builder: &Builder<'_>) -> Interned<PathBuf> {
8073
INTERNER.intern_path(builder.src.join("src/doc"))
8174
}
@@ -108,7 +101,6 @@ impl Step for UnstableBook {
108101
target: self.target,
109102
name: INTERNER.intern_str("unstable-book"),
110103
src: builder.md_doc_out(self.target),
111-
version: RustbookVersion::Latest,
112104
})
113105
}
114106
}
@@ -162,7 +154,6 @@ struct RustbookSrc {
162154
target: Interned<String>,
163155
name: Interned<String>,
164156
src: Interned<PathBuf>,
165-
version: RustbookVersion,
166157
}
167158

168159
impl Step for RustbookSrc {
@@ -194,18 +185,11 @@ impl Step for RustbookSrc {
194185
builder.info(&format!("Rustbook ({}) - {}", target, name));
195186
let _ = fs::remove_dir_all(&out);
196187

197-
let vers = match self.version {
198-
RustbookVersion::MdBook1 => "1",
199-
RustbookVersion::Latest => "3",
200-
};
201-
202188
builder.run(rustbook_cmd
203189
.arg("build")
204190
.arg(&src)
205191
.arg("-d")
206-
.arg(out)
207-
.arg("-m")
208-
.arg(vers));
192+
.arg(out));
209193
}
210194
}
211195

@@ -251,7 +235,6 @@ impl Step for TheBook {
251235
builder.ensure(RustbookSrc {
252236
target,
253237
name: INTERNER.intern_string(name.to_string()),
254-
version: RustbookVersion::Latest,
255238
src: doc_src(builder),
256239
});
257240

@@ -261,23 +244,20 @@ impl Step for TheBook {
261244
builder.ensure(RustbookSrc {
262245
target,
263246
name: INTERNER.intern_string(source_name),
264-
version: RustbookVersion::Latest,
265247
src: doc_src(builder),
266248
});
267249

268250
let source_name = format!("{}/second-edition", name);
269251
builder.ensure(RustbookSrc {
270252
target,
271253
name: INTERNER.intern_string(source_name),
272-
version: RustbookVersion::Latest,
273254
src: doc_src(builder),
274255
});
275256

276257
let source_name = format!("{}/2018-edition", name);
277258
builder.ensure(RustbookSrc {
278259
target,
279260
name: INTERNER.intern_string(source_name),
280-
version: RustbookVersion::Latest,
281261
src: doc_src(builder),
282262
});
283263

src/doc/edition-guide

src/doc/nomicon

src/doc/reference

src/doc/rustc/src/codegen-options/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ This flag allows for creating instrumented binaries that will collect
221221
profiling data for use with profile-guided optimization (PGO). The flag takes
222222
an optional argument which is the path to a directory into which the
223223
instrumented binary will emit the collected data. See the chapter on
224-
[profile-guided optimization](profile-guided-optimization.html) for more
225-
information.
224+
[profile-guided optimization] for more information.
226225

227226
## profile-use
228227

229228
This flag specifies the profiling data file to be used for profile-guided
230229
optimization (PGO). The flag takes a mandatory argument which is the path
231230
to a valid `.profdata` file. See the chapter on
232-
[profile-guided optimization](profile-guided-optimization.html) for more
233-
information.
231+
[profile-guided optimization] for more information.
232+
233+
[profile-guided optimization]: ../profile-guided-optimization.md

src/doc/rustc/src/command-line-arguments.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ of print values are:
161161

162162
## `-g`: include debug information
163163

164-
A synonym for `-C debuginfo=2`, for more see [here](codegen-options/index.html#debuginfo).
164+
A synonym for `-C debuginfo=2`, for more see [here](codegen-options/index.md#debuginfo).
165165

166166
## `-O`: optimize your code
167167

168-
A synonym for `-C opt-level=2`, for more see [here](codegen-options/index.html#opt-level).
168+
A synonym for `-C opt-level=2`, for more see [here](codegen-options/index.md#opt-level).
169169

170170
## `-o`: filename of the output
171171

@@ -188,23 +188,23 @@ and instead produce a test harness.
188188

189189
## `--target`: select a target triple to build
190190

191-
This controls which [target](targets/index.html) to produce.
191+
This controls which [target](targets/index.md) to produce.
192192

193193
## `-W`: set lint warnings
194194

195-
This flag will set which lints should be set to the [warn level](lints/levels.html#warn).
195+
This flag will set which lints should be set to the [warn level](lints/levels.md#warn).
196196

197197
## `-A`: set lint allowed
198198

199-
This flag will set which lints should be set to the [allow level](lints/levels.html#allow).
199+
This flag will set which lints should be set to the [allow level](lints/levels.md#allow).
200200

201201
## `-D`: set lint denied
202202

203-
This flag will set which lints should be set to the [deny level](lints/levels.html#deny).
203+
This flag will set which lints should be set to the [deny level](lints/levels.md#deny).
204204

205205
## `-F`: set lint forbidden
206206

207-
This flag will set which lints should be set to the [forbid level](lints/levels.html#forbid).
207+
This flag will set which lints should be set to the [forbid level](lints/levels.md#forbid).
208208

209209
## `-Z`: set unstable options
210210

@@ -215,11 +215,11 @@ run: `rustc -Z help`.
215215

216216
## `--cap-lints`: set the most restrictive lint level
217217

218-
This flag lets you 'cap' lints, for more, [see here](lints/levels.html#capping-lints).
218+
This flag lets you 'cap' lints, for more, [see here](lints/levels.md#capping-lints).
219219

220220
## `-C`/`--codegen`: code generation options
221221

222-
This flag will allow you to set [codegen options](codegen-options/index.html).
222+
This flag will allow you to set [codegen options](codegen-options/index.md).
223223

224224
## `-V`/`--version`: print a version
225225

0 commit comments

Comments
 (0)