mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
19 lines
566 B
Rust
19 lines
566 B
Rust
use clippy_utils::diagnostics::span_lint;
|
|
use rustc_ast::{FormatArgs, FormatArgsPiece, FormatPlaceholder, FormatTrait};
|
|
use rustc_lint::LateContext;
|
|
|
|
use super::USE_DEBUG;
|
|
|
|
pub(super) fn check(cx: &LateContext<'_>, format_args: &FormatArgs) {
|
|
for piece in &format_args.template {
|
|
if let &FormatArgsPiece::Placeholder(FormatPlaceholder {
|
|
span: Some(span),
|
|
format_trait: FormatTrait::Debug,
|
|
..
|
|
}) = piece
|
|
{
|
|
span_lint(cx, USE_DEBUG, span, "use of `Debug`-based formatting");
|
|
}
|
|
}
|
|
}
|