clippy: fix up include_str! spans in diagnostics
This commit is contained in:
parent
4b10cb20bc
commit
24e1071d21
4 changed files with 8 additions and 9 deletions
|
|
@ -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!(
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue