File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 2
2
// The `dbg` macro generates a literal with the name of the current file, so
3
3
// we need to ensure the lint is not emitted in this case.
4
4
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
+
5
37
#![ crate_name = "foo" ]
6
38
#![ allow( unused) ]
7
39
#![ warn( clippy:: literal_string_with_formatting_args) ]
You can’t perform that action at this time.
0 commit comments