1
1
warning: panic message contains a brace
2
- --> $DIR/panic-brace.rs:5:5
2
+ --> $DIR/panic-brace.rs:8:29
3
3
|
4
4
LL | panic!("here's a brace: {");
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
5
+ | ^
6
6
|
7
7
= note: `#[warn(panic_fmt)]` on by default
8
8
= note: this message is not used as a format string, but will be in a future Rust version
@@ -12,10 +12,10 @@ LL | panic!("{}", "here's a brace: {");
12
12
| ^^^^^
13
13
14
14
warning: panic message contains a brace
15
- --> $DIR/panic-brace.rs:6:5
15
+ --> $DIR/panic-brace.rs:9:31
16
16
|
17
17
LL | std::panic!("another one: }");
18
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
18
+ | ^
19
19
|
20
20
= note: this message is not used as a format string, but will be in a future Rust version
21
21
help: add a "{}" format string to use the message literally
@@ -24,7 +24,7 @@ LL | std::panic!("{}", "another one: }");
24
24
| ^^^^^
25
25
26
26
warning: panic message contains an unused formatting placeholder
27
- --> $DIR/panic-brace.rs:7 :25
27
+ --> $DIR/panic-brace.rs:10 :25
28
28
|
29
29
LL | core::panic!("Hello {}");
30
30
| ^^
@@ -40,7 +40,7 @@ LL | core::panic!("{}", "Hello {}");
40
40
| ^^^^^
41
41
42
42
warning: panic message contains unused formatting placeholders
43
- --> $DIR/panic-brace.rs:8 :21
43
+ --> $DIR/panic-brace.rs:11 :21
44
44
|
45
45
LL | assert!(false, "{:03x} {test} bla");
46
46
| ^^^^^^ ^^^^^^
@@ -55,17 +55,45 @@ help: or add a "{}" format string to use the message literally
55
55
LL | assert!(false, "{}", "{:03x} {test} bla");
56
56
| ^^^^^
57
57
58
- warning: panic message contains a brace
59
- --> $DIR/panic-brace.rs:9:5
58
+ warning: panic message contains braces
59
+ --> $DIR/panic-brace.rs:13:27
60
60
|
61
61
LL | debug_assert!(false, "{{}} bla");
62
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
62
+ | ^^^^
63
63
|
64
64
= note: this message is not used as a format string, but will be in a future Rust version
65
65
help: add a "{}" format string to use the message literally
66
66
|
67
67
LL | debug_assert!(false, "{}", "{{}} bla");
68
68
| ^^^^^
69
69
70
- warning: 5 warnings emitted
70
+ warning: panic message contains an unused formatting placeholder
71
+ --> $DIR/panic-brace.rs:16:12
72
+ |
73
+ LL | panic!(concat!("{", "}"));
74
+ | ^^^^^^^^^^^^^^^^^
75
+ |
76
+ = note: this message is not used as a format string when given without arguments, but will be in a future Rust version
77
+ help: add the missing argument(s)
78
+ |
79
+ LL | panic!(concat!("{", "}"), ...);
80
+ | ^^^^^
81
+ help: or add a "{}" format string to use the message literally
82
+ |
83
+ LL | panic!("{}", concat!("{", "}"));
84
+ | ^^^^^
85
+
86
+ warning: panic message contains braces
87
+ --> $DIR/panic-brace.rs:17:5
88
+ |
89
+ LL | panic!(concat!("{", "{"));
90
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
91
+ |
92
+ = note: this message is not used as a format string, but will be in a future Rust version
93
+ help: add a "{}" format string to use the message literally
94
+ |
95
+ LL | panic!("{}", concat!("{", "{"));
96
+ | ^^^^^
97
+
98
+ warning: 7 warnings emitted
71
99
0 commit comments