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