diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-12 17:41:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-12 17:41:32 +0200 |
| commit | 2e989dc2809937fe33c17995e2147873977d2235 (patch) | |
| tree | 6e34e7bcb21908d61e87b9dfd09e9b0db20b2d02 /clippy_lints | |
| parent | d13ccf3392283ec7c527a78093e1c6e9d627d186 (diff) | |
| parent | 24e1071d21bc41d3224f4fedcd9779b45ebf62f3 (diff) | |
| download | rust-2e989dc2809937fe33c17995e2147873977d2235.tar.gz rust-2e989dc2809937fe33c17995e2147873977d2235.zip | |
Rollup merge of #123204 - notriddle:notriddle/include-str-span, r=pnkfelix
rustdoc: point at span in `include_str!`-ed md file Fixes #118549
Diffstat (limited to 'clippy_lints')
| -rw-r--r-- | clippy_lints/src/large_include_file.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/strings.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/large_include_file.rs b/clippy_lints/src/large_include_file.rs index 0599afca09f..790bed580fd 100644 --- a/clippy_lints/src/large_include_file.rs +++ b/clippy_lints/src/large_include_file.rs @@ -71,7 +71,7 @@ impl LateLintPass<'_> for LargeIncludeFile { span_lint_and_note( cx, LARGE_INCLUDE_FILE, - expr.span, + expr.span.source_callsite(), "attempted to include a large file", None, format!( diff --git a/clippy_lints/src/strings.rs b/clippy_lints/src/strings.rs index b3c729dacdd..3aa979cb11b 100644 --- a/clippy_lints/src/strings.rs +++ b/clippy_lints/src/strings.rs @@ -300,7 +300,7 @@ impl<'tcx> LateLintPass<'tcx> for StringLitAsBytes { e.span, "calling `as_bytes()` on `include_str!(..)`", "consider using `include_bytes!(..)` instead", - snippet_with_applicability(cx, receiver.span, r#""foo""#, &mut applicability).replacen( + snippet_with_applicability(cx, receiver.span.source_callsite(), r#""foo""#, &mut applicability).replacen( "include_str", "include_bytes", 1, |
