about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-13 12:01:12 +0000
committerbors <bors@rust-lang.org>2024-08-13 12:01:12 +0000
commit84e98eb9da3e0b5aabc69c2a5b2a29303c03ea60 (patch)
tree427889ccc64058d02d372265048e62923ac25d93
parent61a252f182210f9a0ad3b75b0fca1800bbd7aaac (diff)
parent819fa6f1806c4432c98137e97e3b251ccf047ae8 (diff)
downloadrust-84e98eb9da3e0b5aabc69c2a5b2a29303c03ea60.tar.gz
rust-84e98eb9da3e0b5aabc69c2a5b2a29303c03ea60.zip
Auto merge of #13265 - antonilol:lint-source-location, r=Alexendoo
Fix lint source location github link (missing a letter 'L')

Links to github ('View Source') were broken by [pull request 13221](https://github.com/rust-lang/rust-clippy/pull/13221/files#diff-dcd0f8da3873f35e9777182474a9d0f287f478c0c02650a1d3fefffe1c8c1d30R159).

also fixed some indentation in docs

changelog: none
-rw-r--r--clippy_lints/src/attrs/mod.rs4
-rw-r--r--clippy_lints/src/operators/mod.rs2
-rw-r--r--declare_clippy_lint/src/lib.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/attrs/mod.rs b/clippy_lints/src/attrs/mod.rs
index 8f430ae601a..5d99001e5aa 100644
--- a/clippy_lints/src/attrs/mod.rs
+++ b/clippy_lints/src/attrs/mod.rs
@@ -310,8 +310,8 @@ declare_clippy_lint! {
     /// ```rust,ignore
     /// #[allow(unused_mut)]
     /// fn foo() -> usize {
-    ///    let mut a = Vec::new();
-    ///    a.len()
+    ///     let mut a = Vec::new();
+    ///     a.len()
     /// }
     /// ```
     /// Use instead:
diff --git a/clippy_lints/src/operators/mod.rs b/clippy_lints/src/operators/mod.rs
index 9baecff801f..9e8a821c3f4 100644
--- a/clippy_lints/src/operators/mod.rs
+++ b/clippy_lints/src/operators/mod.rs
@@ -80,7 +80,7 @@ declare_clippy_lint! {
     /// ```no_run
     /// // `n` can be any number, including `i32::MAX`.
     /// fn foo(n: i32) -> i32 {
-    ///   n + 1
+    ///     n + 1
     /// }
     /// ```
     ///
diff --git a/declare_clippy_lint/src/lib.rs b/declare_clippy_lint/src/lib.rs
index fd366b6b262..6aa24329b06 100644
--- a/declare_clippy_lint/src/lib.rs
+++ b/declare_clippy_lint/src/lib.rs
@@ -156,7 +156,7 @@ pub fn declare_clippy_lint(input: TokenStream) -> TokenStream {
     let category_variant = format_ident!("{category}");
 
     let name_span = name.span().unwrap();
-    let location = format!("{}#{}", name_span.source_file().path().display(), name_span.line());
+    let location = format!("{}#L{}", name_span.source_file().path().display(), name_span.line());
 
     let version = match version {
         Some(version) => quote!(Some(#version)),