File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 22// The `dbg` macro generates a literal with the name of the current file, so
33// we need to ensure the lint is not emitted in this case.
44
5+ // Clippy sets `-Zflatten_format_args=no`, which changes the default behavior of how format args
6+ // are lowered and only that one has this non-macro span. Adding the flag makes it repro on
7+ // godbolt and shows a root context span for the file name string.
8+ //
9+ // So instead of having:
10+ //
11+ // ```
12+ // Lit(
13+ // Spanned {
14+ // node: Str(
15+ // "[/app/example.rs:2:5] \"something\" = ",
16+ // Cooked,
17+ // ),
18+ // span: /rustc/eb54a50837ad4bcc9842924f27e7287ca66e294c/library/std/src/macros.rs:365:35: 365:58 (#4),
19+ // },
20+ // ),
21+ // ```
22+ //
23+ // We get:
24+ //
25+ // ```
26+ // Lit(
27+ // Spanned {
28+ // node: Str(
29+ // "/app/example.rs",
30+ // Cooked,
31+ // ),
32+ // span: /app/example.rs:2:5: 2:22 (#0),
33+ // },
34+ // )
35+ // ```
36+
537#![ crate_name = "foo" ]
638#![ allow( unused) ]
739#![ warn( clippy:: literal_string_with_formatting_args) ]
You can’t perform that action at this time.
0 commit comments