about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuri Astrakhan <YuriAstrakhan@gmail.com>2022-10-06 08:54:07 -0400
committerYuri Astrakhan <YuriAstrakhan@gmail.com>2022-10-06 08:54:07 -0400
commitc251f8d8dd010ac454deec0a39e7a6f3c19204c3 (patch)
treead360971522cc6ce34dd2060913a8c43fccc57d8
parentac0e10aa68325235069a842f47499852b2dee79e (diff)
downloadrust-c251f8d8dd010ac454deec0a39e7a6f3c19204c3.tar.gz
rust-c251f8d8dd010ac454deec0a39e7a6f3c19204c3.zip
lint: fix a few comments
-rw-r--r--clippy_lints/src/format_args.rs12
-rw-r--r--clippy_utils/src/macros.rs2
2 files changed, 1 insertions, 13 deletions
diff --git a/clippy_lints/src/format_args.rs b/clippy_lints/src/format_args.rs
index 88502b72618..d4bb357fb4f 100644
--- a/clippy_lints/src/format_args.rs
+++ b/clippy_lints/src/format_args.rs
@@ -173,18 +173,6 @@ fn check_uninlined_args(cx: &LateContext<'_>, args: &FormatArgsExpn<'_>, call_si
         return;
     }
 
-    // FIXME: Properly ignore a rare case where the format string is wrapped in a macro.
-    // Example:  `format!(indoc!("{}"), foo);`
-    // If inlined, they will cause a compilation error:
-    //     > to avoid ambiguity, `format_args!` cannot capture variables
-    //     > when the format string is expanded from a macro
-    // @Alexendoo explanation:
-    //     > indoc! is a proc macro that is producing a string literal with its span
-    //     > set to its input it's not marked as from expansion, and since it's compatible
-    //     > tokenization wise clippy_utils::is_from_proc_macro wouldn't catch it either
-    // This might be a relatively expensive test, so do it only we are ready to replace.
-    // See more examples in tests/ui/uninlined_format_args.rs
-
     span_lint_and_then(
         cx,
         UNINLINED_FORMAT_ARGS,
diff --git a/clippy_utils/src/macros.rs b/clippy_utils/src/macros.rs
index dd0ce1da657..5a63c290a31 100644
--- a/clippy_utils/src/macros.rs
+++ b/clippy_utils/src/macros.rs
@@ -414,7 +414,7 @@ impl FormatString {
 
 struct FormatArgsValues<'tcx> {
     /// Values passed after the format string and implicit captures. `[1, z + 2, x]` for
-    /// `format!("{x} {} {y}", 1, z + 2)`.
+    /// `format!("{x} {} {}", 1, z + 2)`.
     value_args: Vec<&'tcx Expr<'tcx>>,
     /// Maps an `rt::v1::Argument::position` or an `rt::v1::Count::Param` to its index in
     /// `value_args`