diff --git a/Cargo.lock b/Cargo.lock index 46480aeb4476d..f44ed3d07f4ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,15 +139,6 @@ dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - [[package]] name = "bitflags" version = "1.2.1" @@ -249,7 +240,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ade3d27603c2cb345eb0912aec461a6dec7e06a4ae48589904e808335c7afa" dependencies = [ "byteorder", - "either", "iovec", ] @@ -481,7 +471,7 @@ dependencies = [ "itertools 0.8.0", "lazy_static 1.3.0", "matches", - "pulldown-cmark 0.6.0", + "pulldown-cmark 0.6.1", "quine-mc_cluskey", "regex-syntax", "semver", @@ -914,12 +904,6 @@ dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "dtoa" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" - [[package]] name = "either" version = "1.5.0" @@ -950,15 +934,6 @@ dependencies = [ "log", ] -[[package]] -name = "encoding_rs" -version = "0.8.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4155785c79f2f6701f185eb2e6b4caf0555ec03477cb4c70db67b465311620ed" -dependencies = [ - "cfg-if", -] - [[package]] name = "env_logger" version = "0.6.2" @@ -1162,16 +1137,6 @@ version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -dependencies = [ - "futures", - "num_cpus", -] - [[package]] name = "fwdansi" version = "1.0.1" @@ -1263,24 +1228,6 @@ dependencies = [ name = "graphviz" version = "0.0.0" -[[package]] -name = "h2" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a539b63339fbbb00e081e84b6e11bd1d9634a82d91da2984a18ac74a8823f392" -dependencies = [ - "byteorder", - "bytes", - "fnv", - "futures", - "http", - "indexmap", - "log", - "slab", - "string", - "tokio-io", -] - [[package]] name = "handlebars" version = "2.0.1" @@ -1375,35 +1322,6 @@ dependencies = [ "syn 1.0.5", ] -[[package]] -name = "http" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe67e3678f2827030e89cc4b9e7ecd16d52f132c0b940ab5005f88e821500f6a" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -dependencies = [ - "bytes", - "futures", - "http", - "tokio-buf", -] - -[[package]] -name = "httparse" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" - [[package]] name = "humantime" version = "1.3.0" @@ -1413,49 +1331,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "hyper" -version = "0.12.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6481fff8269772d4463253ca83c788104a7305cb3fb9136bc651a6211e46e03f" -dependencies = [ - "bytes", - "futures", - "futures-cpupool", - "h2", - "http", - "http-body", - "httparse", - "iovec", - "itoa", - "log", - "net2", - "rustc_version", - "time", - "tokio", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" -dependencies = [ - "bytes", - "futures", - "hyper", - "native-tls", - "tokio-io", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -1703,7 +1578,7 @@ dependencies = [ "num_cpus", "tokio", "tokio-codec", - "unicase 2.5.1", + "unicase", ] [[package]] @@ -1743,19 +1618,6 @@ dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "libflate" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c6f86f4b0caa347206f916f8b687b51d77c6ef8ff18d52dd007491fd580529" -dependencies = [ - "adler32", - "byteorder", - "crc32fast", - "rle-decode-fast", - "take_mut", -] - [[package]] name = "libgit2-sys" version = "0.9.0" @@ -1925,9 +1787,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "mdbook" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a070268274c566082efb6b2ace7743e43ba91a70d5c6982981e96d3c05ac81c" +checksum = "031bdd9d4893c983e2f69ebc4b59070feee8276a584c4aabdcb351235ea28016" dependencies = [ "ammonia", "chrono", @@ -1941,7 +1803,7 @@ dependencies = [ "log", "memchr", "open", - "pulldown-cmark 0.5.3", + "pulldown-cmark 0.6.1", "regex", "serde", "serde_derive", @@ -1952,29 +1814,6 @@ dependencies = [ "toml-query", ] -[[package]] -name = "mdbook-linkcheck" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d1f0ba4d1e6b86fa18e8853d026d7d76a97eb7eb5eb052ed80901e43b7fc10" -dependencies = [ - "env_logger 0.6.2", - "failure", - "log", - "mdbook", - "memchr", - "pulldown-cmark 0.5.3", - "rayon", - "regex", - "reqwest", - "semver", - "serde", - "serde_derive", - "serde_json", - "structopt 0.2.18", - "url 1.7.2", -] - [[package]] name = "measureme" version = "0.4.0" @@ -2017,27 +1856,6 @@ dependencies = [ "rustc_version", ] -[[package]] -name = "mime" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" -dependencies = [ - "unicase 2.5.1", -] - -[[package]] -name = "mime_guess" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30de2e4613efcba1ec63d8133f344076952090c122992a903359be5a4f99c3ed" -dependencies = [ - "mime", - "phf", - "phf_codegen", - "unicase 1.4.2", -] - [[package]] name = "minifier" version = "0.0.33" @@ -2163,24 +1981,6 @@ dependencies = [ "vergen", ] -[[package]] -name = "native-tls" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" -dependencies = [ - "lazy_static 1.3.0", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "net2" version = "0.2.33" @@ -2511,7 +2311,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" dependencies = [ "siphasher", - "unicase 1.4.2", ] [[package]] @@ -2625,21 +2424,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77043da1282374688ee212dc44b3f37ff929431de9c9adc3053bd3cee5630357" dependencies = [ "bitflags", - "getopts", "memchr", - "unicase 2.5.1", + "unicase", ] [[package]] name = "pulldown-cmark" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b0ad0d4c1702965ee6bb5b4ff5e71f83850b497d497e9444302987bf9e26a4" +checksum = "1c205cc82214f3594e2d50686730314f817c67ffa80fe800cf0db78c3c2b9d9e" dependencies = [ "bitflags", "getopts", "memchr", - "unicase 2.5.1", + "unicase", ] [[package]] @@ -2936,42 +2734,6 @@ dependencies = [ "winapi 0.3.6", ] -[[package]] -name = "reqwest" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e542d9f077c126af32536b6aacc75bb7325400eab8cd0743543be5d91660780d" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures", - "http", - "hyper", - "hyper-tls", - "libflate", - "log", - "mime", - "mime_guess", - "native-tls", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-executor", - "tokio-io", - "tokio-threadpool", - "tokio-timer", - "url 1.7.2", - "uuid", -] - -[[package]] -name = "rle-decode-fast" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" - [[package]] name = "rls" version = "1.40.0" @@ -3101,7 +2863,6 @@ dependencies = [ "clap", "failure", "mdbook", - "mdbook-linkcheck", "rustc-workspace-hack", ] @@ -3907,7 +3668,7 @@ dependencies = [ "rustfmt-config_proc_macro", "serde", "serde_json", - "structopt 0.3.1", + "structopt", "term 0.6.0", "toml", "unicode-segmentation", @@ -3964,27 +3725,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -[[package]] -name = "security-framework" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee63d0f4a9ec776eeb30e220f0bc1e092c3ad744b2a379e3993070364d3adc2" -dependencies = [ - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9636f8989cbf61385ae4824b98c1aaa54c994d7d8b41f11c601ed799f0549a56" -dependencies = [ - "core-foundation-sys", -] - [[package]] name = "semver" version = "0.9.0" @@ -4052,18 +3792,6 @@ dependencies = [ "syn 1.0.5", ] -[[package]] -name = "serde_urlencoded" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" -dependencies = [ - "dtoa", - "itoa", - "serde", - "url 1.7.2", -] - [[package]] name = "serialize" version = "0.0.0" @@ -4177,15 +3905,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes", -] - [[package]] name = "string_cache" version = "0.7.3" @@ -4235,16 +3954,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "structopt" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7" -dependencies = [ - "clap", - "structopt-derive 0.2.18", -] - [[package]] name = "structopt" version = "0.3.1" @@ -4252,19 +3961,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ac9d6e93dd792b217bf89cda5c14566e3043960c6f9da890c2ba5d09d07804c" dependencies = [ "clap", - "structopt-derive 0.3.1", -] - -[[package]] -name = "structopt-derive" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107" -dependencies = [ - "heck", - "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "structopt-derive", ] [[package]] @@ -4410,12 +4107,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - [[package]] name = "tar" version = "0.4.20" @@ -4580,17 +4271,6 @@ dependencies = [ "tokio-uds", ] -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -dependencies = [ - "bytes", - "either", - "futures", -] - [[package]] name = "tokio-codec" version = "0.1.1" @@ -4827,12 +4507,6 @@ dependencies = [ "syn 0.15.35", ] -[[package]] -name = "try-lock" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" - [[package]] name = "typenum" version = "1.10.0" @@ -4851,15 +4525,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -dependencies = [ - "version_check", -] - [[package]] name = "unicase" version = "2.5.1" @@ -4979,15 +4644,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d" -[[package]] -name = "uuid" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" -dependencies = [ - "rand 0.6.1", -] - [[package]] name = "vcpkg" version = "0.2.6" @@ -5037,17 +4693,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -dependencies = [ - "futures", - "log", - "try-lock", -] - [[package]] name = "wasi" version = "0.7.0" diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index 89bbde4d5a9e3..67da04dd67fc3 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -6,12 +6,11 @@ license = "MIT OR Apache-2.0" edition = "2018" [features] -linkcheck = ["mdbook-linkcheck"] +linkcheck = [] [dependencies] clap = "2.25.0" failure = "0.1" -mdbook-linkcheck = { version = "0.3.0", optional = true } # A noop dependency that changes in the Rust repository, it's a bit of a hack. # See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` @@ -19,6 +18,6 @@ mdbook-linkcheck = { version = "0.3.0", optional = true } rustc-workspace-hack = "1.0.0" [dependencies.mdbook] -version = "0.3.0" +version = "0.3.5" default-features = false features = ["search"] diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index d5dc9a79b5acb..e0f8bcc7424ea 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -8,13 +8,6 @@ use clap::{App, AppSettings, ArgMatches, SubCommand}; use mdbook::errors::Result as Result3; use mdbook::MDBook; -#[cfg(feature = "linkcheck")] -use failure::Error; -#[cfg(feature = "linkcheck")] -use mdbook::renderer::RenderContext; -#[cfg(feature = "linkcheck")] -use mdbook_linkcheck::{self, errors::BrokenLinks}; - fn main() { let d_message = "-d, --dest-dir=[dest-dir] 'The output directory for your book{n}(Defaults to ./book when omitted)'"; @@ -53,56 +46,12 @@ fn main() { } } ("linkcheck", Some(sub_matches)) => { - #[cfg(feature = "linkcheck")] - { - if let Err(err) = linkcheck(sub_matches) { - eprintln!("Error: {}", err); - - // HACK: ignore timeouts - let actually_broken = err - .downcast::() - .map(|broken_links| { - broken_links - .links() - .iter() - .inspect(|cause| eprintln!("\tCaused By: {}", cause)) - .fold(false, |already_broken, cause| { - already_broken || !format!("{}", cause).contains("timed out") - }) - }) - .unwrap_or(false); - - if actually_broken { - std::process::exit(101); - } else { - std::process::exit(0); - } - } - } - - #[cfg(not(feature = "linkcheck"))] - { - // This avoids the `unused_binding` lint. - println!( - "mdbook-linkcheck is disabled, but arguments were passed: {:?}", - sub_matches - ); - } + println!("mdbook-linkcheck is disabled, but arguments were passed: {:?}", sub_matches); } (_, _) => unreachable!(), }; } -#[cfg(feature = "linkcheck")] -pub fn linkcheck(args: &ArgMatches<'_>) -> Result<(), Error> { - let book_dir = get_book_dir(args); - let book = MDBook::load(&book_dir).unwrap(); - let cfg = book.config; - let render_ctx = RenderContext::new(&book_dir, book.book, cfg, &book_dir); - - mdbook_linkcheck::check_links(&render_ctx) -} - // Build command implementation pub fn build(args: &ArgMatches<'_>) -> Result3<()> { let book_dir = get_book_dir(args); @@ -124,11 +73,7 @@ fn get_book_dir(args: &ArgMatches<'_>) -> PathBuf { if let Some(dir) = args.value_of("dir") { // Check if path is relative from current dir, or absolute... let p = Path::new(dir); - if p.is_relative() { - env::current_dir().unwrap().join(dir) - } else { - p.to_path_buf() - } + if p.is_relative() { env::current_dir().unwrap().join(dir) } else { p.to_path_buf() } } else { env::current_dir().unwrap() }