diff options
| author | Eric Huss <eric@huss.org> | 2019-07-08 14:52:07 -0700 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2019-07-17 12:46:36 -0700 |
| commit | 04538c680c7a18b9e9a8419456aa3c6f82e2403b (patch) | |
| tree | 4170c957e3baa82a496099ac6ac1573cdda0afd2 /src | |
| parent | 2eb0bc5e3c52a34b6d62ab0527520c66e4c575bd (diff) | |
| download | rust-04538c680c7a18b9e9a8419456aa3c6f82e2403b.tar.gz rust-04538c680c7a18b9e9a8419456aa3c6f82e2403b.zip | |
Update mdbook, cargo, books
This updates the last of the books using mdbook 0.1, finally removing it from the build.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/doc.rs | 38 | ||||
| m--------- | src/doc/book | 0 | ||||
| m--------- | src/doc/edition-guide | 0 | ||||
| m--------- | src/doc/embedded-book | 0 | ||||
| m--------- | src/doc/nomicon | 0 | ||||
| m--------- | src/doc/reference | 0 | ||||
| m--------- | src/doc/rust-by-example | 0 | ||||
| -rw-r--r-- | src/doc/rustc/src/codegen-options/index.md | 8 | ||||
| -rw-r--r-- | src/doc/rustc/src/command-line-arguments.md | 18 | ||||
| m--------- | src/tools/cargo | 0 | ||||
| -rw-r--r-- | src/tools/rustbook/Cargo.toml | 6 | ||||
| -rw-r--r-- | src/tools/rustbook/src/main.rs | 55 |
12 files changed, 29 insertions, 96 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 2969bbf5b00..36229720e42 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -23,7 +23,7 @@ use crate::cache::{INTERNER, Interned}; use crate::config::Config; macro_rules! book { - ($($name:ident, $path:expr, $book_name:expr, $book_ver:expr;)+) => { + ($($name:ident, $path:expr, $book_name:expr;)+) => { $( #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct $name { @@ -49,7 +49,6 @@ macro_rules! book { builder.ensure(RustbookSrc { target: self.target, name: INTERNER.intern_str($book_name), - version: $book_ver, src: doc_src(builder), }) } @@ -61,21 +60,15 @@ macro_rules! book { // NOTE: When adding a book here, make sure to ALSO build the book by // adding a build step in `src/bootstrap/builder.rs`! book!( - EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::Latest; - EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::Latest; - Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::Latest; - Reference, "src/doc/reference", "reference", RustbookVersion::MdBook1; - RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::Latest; - RustcBook, "src/doc/rustc", "rustc", RustbookVersion::MdBook1; - RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::Latest; + EditionGuide, "src/doc/edition-guide", "edition-guide"; + EmbeddedBook, "src/doc/embedded-book", "embedded-book"; + Nomicon, "src/doc/nomicon", "nomicon"; + Reference, "src/doc/reference", "reference"; + RustByExample, "src/doc/rust-by-example", "rust-by-example"; + RustcBook, "src/doc/rustc", "rustc"; + RustdocBook, "src/doc/rustdoc", "rustdoc"; ); -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -enum RustbookVersion { - MdBook1, - Latest, -} - fn doc_src(builder: &Builder<'_>) -> Interned<PathBuf> { INTERNER.intern_path(builder.src.join("src/doc")) } @@ -108,7 +101,6 @@ impl Step for UnstableBook { target: self.target, name: INTERNER.intern_str("unstable-book"), src: builder.md_doc_out(self.target), - version: RustbookVersion::Latest, }) } } @@ -162,7 +154,6 @@ struct RustbookSrc { target: Interned<String>, name: Interned<String>, src: Interned<PathBuf>, - version: RustbookVersion, } impl Step for RustbookSrc { @@ -194,18 +185,11 @@ impl Step for RustbookSrc { builder.info(&format!("Rustbook ({}) - {}", target, name)); let _ = fs::remove_dir_all(&out); - let vers = match self.version { - RustbookVersion::MdBook1 => "1", - RustbookVersion::Latest => "3", - }; - builder.run(rustbook_cmd .arg("build") .arg(&src) .arg("-d") - .arg(out) - .arg("-m") - .arg(vers)); + .arg(out)); } } @@ -251,7 +235,6 @@ impl Step for TheBook { builder.ensure(RustbookSrc { target, name: INTERNER.intern_string(name.to_string()), - version: RustbookVersion::Latest, src: doc_src(builder), }); @@ -261,7 +244,6 @@ impl Step for TheBook { builder.ensure(RustbookSrc { target, name: INTERNER.intern_string(source_name), - version: RustbookVersion::Latest, src: doc_src(builder), }); @@ -269,7 +251,6 @@ impl Step for TheBook { builder.ensure(RustbookSrc { target, name: INTERNER.intern_string(source_name), - version: RustbookVersion::Latest, src: doc_src(builder), }); @@ -277,7 +258,6 @@ impl Step for TheBook { builder.ensure(RustbookSrc { target, name: INTERNER.intern_string(source_name), - version: RustbookVersion::Latest, src: doc_src(builder), }); diff --git a/src/doc/book b/src/doc/book -Subproject 6c0d83499c8e77e06a71d28c5e1adccec278d4f +Subproject 7ddc46460f09a5cd9bd2a620565bdc20b3315ea diff --git a/src/doc/edition-guide b/src/doc/edition-guide -Subproject f8072acde5ce29c7570d7986180bbded2d22e28 +Subproject f6c8b92d4e63edd28e862be952f33861f35956f diff --git a/src/doc/embedded-book b/src/doc/embedded-book -Subproject ef27b517dcd0b990c888c0d7caeff52a5a11561 +Subproject ff334e74fdb9f197e621efa6d7c3105be892e88 diff --git a/src/doc/nomicon b/src/doc/nomicon -Subproject 341c221116a8b9f1010cf1eece952b80c5ec7f5 +Subproject b7f0aba2f88a8feade70595efcfa3438e54e96c diff --git a/src/doc/reference b/src/doc/reference -Subproject 7a5aab5fd50d6290679beb4cf42fa5f46ed22ae +Subproject 8e7d614303b0dec7492e048e63855fcd3b944ec diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example -Subproject 62b3ff2cb44dd8b648c3ef2a9347c3706d14801 +Subproject e3679e214d8db44586aca9b20aa27517007d192 diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md index 3773a778302..5c41acc6581 100644 --- a/src/doc/rustc/src/codegen-options/index.md +++ b/src/doc/rustc/src/codegen-options/index.md @@ -221,13 +221,13 @@ This flag allows for creating instrumented binaries that will collect profiling data for use with profile-guided optimization (PGO). The flag takes an optional argument which is the path to a directory into which the instrumented binary will emit the collected data. See the chapter on -[profile-guided optimization](profile-guided-optimization.html) for more -information. +[profile-guided optimization] for more information. ## profile-use This flag specifies the profiling data file to be used for profile-guided optimization (PGO). The flag takes a mandatory argument which is the path to a valid `.profdata` file. See the chapter on -[profile-guided optimization](profile-guided-optimization.html) for more -information. +[profile-guided optimization] for more information. + +[profile-guided optimization]: ../profile-guided-optimization.md diff --git a/src/doc/rustc/src/command-line-arguments.md b/src/doc/rustc/src/command-line-arguments.md index bd7f6630ea2..3af2a51ce5e 100644 --- a/src/doc/rustc/src/command-line-arguments.md +++ b/src/doc/rustc/src/command-line-arguments.md @@ -161,11 +161,11 @@ of print values are: ## `-g`: include debug information -A synonym for `-C debuginfo=2`, for more see [here](codegen-options/index.html#debuginfo). +A synonym for `-C debuginfo=2`, for more see [here](codegen-options/index.md#debuginfo). ## `-O`: optimize your code -A synonym for `-C opt-level=2`, for more see [here](codegen-options/index.html#opt-level). +A synonym for `-C opt-level=2`, for more see [here](codegen-options/index.md#opt-level). ## `-o`: filename of the output @@ -188,23 +188,23 @@ and instead produce a test harness. ## `--target`: select a target triple to build -This controls which [target](targets/index.html) to produce. +This controls which [target](targets/index.md) to produce. ## `-W`: set lint warnings -This flag will set which lints should be set to the [warn level](lints/levels.html#warn). +This flag will set which lints should be set to the [warn level](lints/levels.md#warn). ## `-A`: set lint allowed -This flag will set which lints should be set to the [allow level](lints/levels.html#allow). +This flag will set which lints should be set to the [allow level](lints/levels.md#allow). ## `-D`: set lint denied -This flag will set which lints should be set to the [deny level](lints/levels.html#deny). +This flag will set which lints should be set to the [deny level](lints/levels.md#deny). ## `-F`: set lint forbidden -This flag will set which lints should be set to the [forbid level](lints/levels.html#forbid). +This flag will set which lints should be set to the [forbid level](lints/levels.md#forbid). ## `-Z`: set unstable options @@ -215,11 +215,11 @@ run: `rustc -Z help`. ## `--cap-lints`: set the most restrictive lint level -This flag lets you 'cap' lints, for more, [see here](lints/levels.html#capping-lints). +This flag lets you 'cap' lints, for more, [see here](lints/levels.md#capping-lints). ## `-C`/`--codegen`: code generation options -This flag will allow you to set [codegen options](codegen-options/index.html). +This flag will allow you to set [codegen options](codegen-options/index.md). ## `-V`/`--version`: print a version diff --git a/src/tools/cargo b/src/tools/cargo -Subproject 677a180f4c8ca1dcef594f68dd0e63e4f08621f +Subproject e3563dbdcd2e370bc4f11d080f739d82d25773f diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index 15a71df93a2..bb10d06851b 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -14,11 +14,5 @@ version = "0.3.0" default-features = false features = ["search"] -[dependencies.mdbook_1] -package = "mdbook" -version = "0.1.7" -default-features = false -features = ["search"] - [target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dependencies] mdbook-linkcheck = "0.3.0" diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index c9e240049a1..4689bee3e13 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -7,9 +7,6 @@ use std::path::{Path, PathBuf}; use clap::{App, ArgMatches, SubCommand, AppSettings}; -use mdbook_1::{MDBook as MDBook1}; -use mdbook_1::errors::{Result as Result1}; - use mdbook::MDBook; use mdbook::errors::{Result as Result3}; @@ -25,8 +22,6 @@ fn main() { 'The output directory for your book{n}(Defaults to ./book when omitted)'"; let dir_message = "[dir] 'A directory for your book{n}(Defaults to Current Directory when omitted)'"; - let vers_message = "-m, --mdbook-vers=[md-version] -'The version of mdbook to use for your book{n}(Defaults to 1 when omitted)'"; let matches = App::new("rustbook") .about("Build a book with mdBook") @@ -36,8 +31,7 @@ fn main() { .subcommand(SubCommand::with_name("build") .about("Build the book from the markdown files") .arg_from_usage(d_message) - .arg_from_usage(dir_message) - .arg_from_usage(vers_message)) + .arg_from_usage(dir_message)) .subcommand(SubCommand::with_name("linkcheck") .about("Run linkcheck with mdBook 3") .arg_from_usage(dir_message)) @@ -46,33 +40,15 @@ fn main() { // Check which subcomamnd the user ran... match matches.subcommand() { ("build", Some(sub_matches)) => { - match sub_matches.value_of("mdbook-vers") { - None | Some("1") => { - if let Err(e) = build_1(sub_matches) { - eprintln!("Error: {}", e); - - for cause in e.iter().skip(1) { - eprintln!("\tCaused By: {}", cause); - } + if let Err(e) = build(sub_matches) { + eprintln!("Error: {}", e); - ::std::process::exit(101); - } + for cause in e.iter().skip(1) { + eprintln!("\tCaused By: {}", cause); } - Some("2") | Some("3") => { - if let Err(e) = build(sub_matches) { - eprintln!("Error: {}", e); - for cause in e.iter().skip(1) { - eprintln!("\tCaused By: {}", cause); - } - - ::std::process::exit(101); - } - } - _ => { - panic!("Invalid mdBook version! Select '1' or '2' or '3'"); - } - }; + ::std::process::exit(101); + } }, ("linkcheck", Some(sub_matches)) => { if let Err(err) = linkcheck(sub_matches) { @@ -111,23 +87,6 @@ pub fn linkcheck(_args: &ArgMatches<'_>) -> Result<(), Error> { } // Build command implementation -pub fn build_1(args: &ArgMatches<'_>) -> Result1<()> { - let book_dir = get_book_dir(args); - let mut book = MDBook1::load(&book_dir)?; - - // Set this to allow us to catch bugs in advance. - book.config.build.create_missing = false; - - if let Some(dest_dir) = args.value_of("dest-dir") { - book.config.build.build_dir = PathBuf::from(dest_dir); - } - - book.build()?; - - Ok(()) -} - -// Build command implementation pub fn build(args: &ArgMatches<'_>) -> Result3<()> { let book_dir = get_book_dir(args); let mut book = MDBook::load(&book_dir)?; |
