Skip to content

Commit 45343e2

Browse files
committed
Auto merge of #9598 - nyurik:fix-comment, r=Alexendoo
lint: fix a few comments minor cleanup per `@Alexendoo` [comment](rust-lang/rust-clippy#9586 (comment)) changelog: none
2 parents ac0e10a + c251f8d commit 45343e2

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

clippy_lints/src/format_args.rs

-12
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,6 @@ fn check_uninlined_args(cx: &LateContext<'_>, args: &FormatArgsExpn<'_>, call_si
173173
return;
174174
}
175175

176-
// FIXME: Properly ignore a rare case where the format string is wrapped in a macro.
177-
// Example: `format!(indoc!("{}"), foo);`
178-
// If inlined, they will cause a compilation error:
179-
// > to avoid ambiguity, `format_args!` cannot capture variables
180-
// > when the format string is expanded from a macro
181-
// @Alexendoo explanation:
182-
// > indoc! is a proc macro that is producing a string literal with its span
183-
// > set to its input it's not marked as from expansion, and since it's compatible
184-
// > tokenization wise clippy_utils::is_from_proc_macro wouldn't catch it either
185-
// This might be a relatively expensive test, so do it only we are ready to replace.
186-
// See more examples in tests/ui/uninlined_format_args.rs
187-
188176
span_lint_and_then(
189177
cx,
190178
UNINLINED_FORMAT_ARGS,

clippy_utils/src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ impl FormatString {
414414

415415
struct FormatArgsValues<'tcx> {
416416
/// Values passed after the format string and implicit captures. `[1, z + 2, x]` for
417-
/// `format!("{x} {} {y}", 1, z + 2)`.
417+
/// `format!("{x} {} {}", 1, z + 2)`.
418418
value_args: Vec<&'tcx Expr<'tcx>>,
419419
/// Maps an `rt::v1::Argument::position` or an `rt::v1::Count::Param` to its index in
420420
/// `value_args`

0 commit comments

Comments
 (0)