Skip to content

Commit 84e98eb

Browse files
committed
Auto merge of rust-lang#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
2 parents 61a252f + 819fa6f commit 84e98eb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clippy_lints/src/attrs/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ declare_clippy_lint! {
310310
/// ```rust,ignore
311311
/// #[allow(unused_mut)]
312312
/// fn foo() -> usize {
313-
/// let mut a = Vec::new();
314-
/// a.len()
313+
/// let mut a = Vec::new();
314+
/// a.len()
315315
/// }
316316
/// ```
317317
/// Use instead:

clippy_lints/src/operators/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ declare_clippy_lint! {
8080
/// ```no_run
8181
/// // `n` can be any number, including `i32::MAX`.
8282
/// fn foo(n: i32) -> i32 {
83-
/// n + 1
83+
/// n + 1
8484
/// }
8585
/// ```
8686
///

declare_clippy_lint/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub fn declare_clippy_lint(input: TokenStream) -> TokenStream {
156156
let category_variant = format_ident!("{category}");
157157

158158
let name_span = name.span().unwrap();
159-
let location = format!("{}#{}", name_span.source_file().path().display(), name_span.line());
159+
let location = format!("{}#L{}", name_span.source_file().path().display(), name_span.line());
160160

161161
let version = match version {
162162
Some(version) => quote!(Some(#version)),

0 commit comments

Comments
 (0)