diff options
| author | Michael Howell <michael@notriddle.com> | 2024-03-29 13:34:01 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2024-03-29 13:34:01 -0700 |
| commit | 24e1071d21bc41d3224f4fedcd9779b45ebf62f3 (patch) | |
| tree | 7482f41519a74ba275f1f6092252da5697e83f96 /clippy_lints | |
| parent | 4b10cb20bc2eda0cbbc8dfd6a7e33461e2512f15 (diff) | |
| download | rust-24e1071d21bc41d3224f4fedcd9779b45ebf62f3.tar.gz rust-24e1071d21bc41d3224f4fedcd9779b45ebf62f3.zip | |
clippy: fix up `include_str!` spans in diagnostics
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 1b5981ecc28..553d447d440 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 13ae1ff52dd..21790134854 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, |
