From 82c9d5ff2f01c2f0f6df3c3a0969659011215df8 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 26 Aug 2024 11:27:50 -0700 Subject: [PATCH] Sync denied lints with upstream This synchronizes the lints in mdbook-spec that are denied in rust-lang/rust. This unblocks updating the books. --- mdbook-spec/src/lib.rs | 2 ++ mdbook-spec/src/std_links.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mdbook-spec/src/lib.rs b/mdbook-spec/src/lib.rs index ef1d56501..1a8a919dc 100644 --- a/mdbook-spec/src/lib.rs +++ b/mdbook-spec/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(rust_2018_idioms, unused_lifetimes)] + use mdbook::book::{Book, Chapter}; use mdbook::errors::Error; use mdbook::preprocess::{CmdPreprocessor, Preprocessor, PreprocessorContext}; diff --git a/mdbook-spec/src/std_links.rs b/mdbook-spec/src/std_links.rs index d0b017999..28ca6ba51 100644 --- a/mdbook-spec/src/std_links.rs +++ b/mdbook-spec/src/std_links.rs @@ -145,7 +145,7 @@ fn collect_markdown_links(chapter: &Chapter) -> Vec> { // Broken links are collected so that you can write something like // `[std::option::Option]` which in pulldown_cmark's eyes is a broken // link. However, that is the normal syntax for rustdoc. - let broken_link = |broken_link: BrokenLink| { + let broken_link = |broken_link: BrokenLink<'_>| { broken_links.push(Link { link_type: broken_link.link_type, // Necessary due to lifetime issues. @@ -205,7 +205,7 @@ fn collect_markdown_links(chapter: &Chapter) -> Vec> { /// generate intra-doc links on them. /// /// The output will be in the given `tmp` directory. -fn run_rustdoc(tmp: &TempDir, chapter_links: &HashMap<&PathBuf, Vec>) { +fn run_rustdoc(tmp: &TempDir, chapter_links: &HashMap<&PathBuf, Vec>>) { let src_path = tmp.path().join("a.rs"); // Allow redundant since there could some in-scope things that are // technically not necessary, but we don't care about (like