From 2e26fdc2a86f03771a31b8a1e1a35cf8397cb69b Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Wed, 21 Nov 2018 13:33:42 +0100 Subject: [PATCH] Enable rustup clippy to refer to the correct documentation --- clippy_lints/src/utils/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 05356f8d385..410819136bc 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -507,8 +507,11 @@ impl<'a> DiagnosticWrapper<'a> { fn docs_link(&mut self, lint: &'static Lint) { if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() { self.0.help(&format!( - "for further information visit https://rust-lang-nursery.github.io/rust-clippy/v{}/index.html#{}", - env!("CARGO_PKG_VERSION"), + "for further information visit https://rust-lang-nursery.github.io/rust-clippy/{}/index.html#{}", + &option_env!("RUST_RELEASE_NUM").map_or("master".to_string(), |n| { + // extract just major + minor version and ignore patch versions + format!("rust-{}", n.rsplitn(2, '.').nth(1).unwrap()) + }), lint.name_lower().replacen("clippy::", "", 1) )); }