Skip to content

Commit 3816f9a

Browse files
committed
Auto merge of rust-lang#10137 - euclio:dbg-macro, r=giraffate
reword dbg_macro labels --- This change rewords the `dbg_macro` lint labels to be clearer. changelog: none <!-- changelog_checked -->
2 parents 4f4c961 + 9aef1a2 commit 3816f9a

File tree

3 files changed

+49
-49
lines changed

3 files changed

+49
-49
lines changed

clippy_lints/src/dbg_macro.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use rustc_span::sym;
1010

1111
declare_clippy_lint! {
1212
/// ### What it does
13-
/// Checks for usage of dbg!() macro.
13+
/// Checks for usage of the [`dbg!`](https://doc.rust-lang.org/std/macro.dbg.html) macro.
1414
///
1515
/// ### Why is this bad?
16-
/// `dbg!` macro is intended as a debugging tool. It
17-
/// should not be in version control.
16+
/// The `dbg!` macro is intended as a debugging tool. It should not be present in released
17+
/// software or committed to a version control system.
1818
///
1919
/// ### Example
2020
/// ```rust,ignore
@@ -91,8 +91,8 @@ impl LateLintPass<'_> for DbgMacro {
9191
cx,
9292
DBG_MACRO,
9393
macro_call.span,
94-
"`dbg!` macro is intended as a debugging tool",
95-
"ensure to avoid having uses of it in version control",
94+
"the `dbg!` macro is intended as a debugging tool",
95+
"remove the invocation before committing it to a version control system",
9696
suggestion,
9797
applicability,
9898
);

tests/ui-toml/dbg_macro/dbg_macro.stderr

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,99 @@
1-
error: `dbg!` macro is intended as a debugging tool
1+
error: the `dbg!` macro is intended as a debugging tool
22
--> $DIR/dbg_macro.rs:5:22
33
|
44
LL | if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::dbg-macro` implied by `-D warnings`
8-
help: ensure to avoid having uses of it in version control
8+
help: remove the invocation before committing it to a version control system
99
|
1010
LL | if let Some(n) = n.checked_sub(4) { n } else { n }
1111
| ~~~~~~~~~~~~~~~~
1212

13-
error: `dbg!` macro is intended as a debugging tool
13+
error: the `dbg!` macro is intended as a debugging tool
1414
--> $DIR/dbg_macro.rs:9:8
1515
|
1616
LL | if dbg!(n <= 1) {
1717
| ^^^^^^^^^^^^
1818
|
19-
help: ensure to avoid having uses of it in version control
19+
help: remove the invocation before committing it to a version control system
2020
|
2121
LL | if n <= 1 {
2222
| ~~~~~~
2323

24-
error: `dbg!` macro is intended as a debugging tool
24+
error: the `dbg!` macro is intended as a debugging tool
2525
--> $DIR/dbg_macro.rs:10:9
2626
|
2727
LL | dbg!(1)
2828
| ^^^^^^^
2929
|
30-
help: ensure to avoid having uses of it in version control
30+
help: remove the invocation before committing it to a version control system
3131
|
3232
LL | 1
3333
|
3434

35-
error: `dbg!` macro is intended as a debugging tool
35+
error: the `dbg!` macro is intended as a debugging tool
3636
--> $DIR/dbg_macro.rs:12:9
3737
|
3838
LL | dbg!(n * factorial(n - 1))
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
4040
|
41-
help: ensure to avoid having uses of it in version control
41+
help: remove the invocation before committing it to a version control system
4242
|
4343
LL | n * factorial(n - 1)
4444
|
4545

46-
error: `dbg!` macro is intended as a debugging tool
46+
error: the `dbg!` macro is intended as a debugging tool
4747
--> $DIR/dbg_macro.rs:17:5
4848
|
4949
LL | dbg!(42);
5050
| ^^^^^^^^
5151
|
52-
help: ensure to avoid having uses of it in version control
52+
help: remove the invocation before committing it to a version control system
5353
|
5454
LL | 42;
5555
| ~~
5656

57-
error: `dbg!` macro is intended as a debugging tool
57+
error: the `dbg!` macro is intended as a debugging tool
5858
--> $DIR/dbg_macro.rs:18:5
5959
|
6060
LL | dbg!(dbg!(dbg!(42)));
6161
| ^^^^^^^^^^^^^^^^^^^^
6262
|
63-
help: ensure to avoid having uses of it in version control
63+
help: remove the invocation before committing it to a version control system
6464
|
6565
LL | dbg!(dbg!(42));
6666
| ~~~~~~~~~~~~~~
6767

68-
error: `dbg!` macro is intended as a debugging tool
68+
error: the `dbg!` macro is intended as a debugging tool
6969
--> $DIR/dbg_macro.rs:19:14
7070
|
7171
LL | foo(3) + dbg!(factorial(4));
7272
| ^^^^^^^^^^^^^^^^^^
7373
|
74-
help: ensure to avoid having uses of it in version control
74+
help: remove the invocation before committing it to a version control system
7575
|
7676
LL | foo(3) + factorial(4);
7777
| ~~~~~~~~~~~~
7878

79-
error: `dbg!` macro is intended as a debugging tool
79+
error: the `dbg!` macro is intended as a debugging tool
8080
--> $DIR/dbg_macro.rs:20:5
8181
|
8282
LL | dbg!(1, 2, dbg!(3, 4));
8383
| ^^^^^^^^^^^^^^^^^^^^^^
8484
|
85-
help: ensure to avoid having uses of it in version control
85+
help: remove the invocation before committing it to a version control system
8686
|
8787
LL | (1, 2, dbg!(3, 4));
8888
| ~~~~~~~~~~~~~~~~~~
8989

90-
error: `dbg!` macro is intended as a debugging tool
90+
error: the `dbg!` macro is intended as a debugging tool
9191
--> $DIR/dbg_macro.rs:21:5
9292
|
9393
LL | dbg!(1, 2, 3, 4, 5);
9494
| ^^^^^^^^^^^^^^^^^^^
9595
|
96-
help: ensure to avoid having uses of it in version control
96+
help: remove the invocation before committing it to a version control system
9797
|
9898
LL | (1, 2, 3, 4, 5);
9999
| ~~~~~~~~~~~~~~~

tests/ui/dbg_macro.stderr

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,143 @@
1-
error: `dbg!` macro is intended as a debugging tool
1+
error: the `dbg!` macro is intended as a debugging tool
22
--> $DIR/dbg_macro.rs:5:22
33
|
44
LL | if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::dbg-macro` implied by `-D warnings`
8-
help: ensure to avoid having uses of it in version control
8+
help: remove the invocation before committing it to a version control system
99
|
1010
LL | if let Some(n) = n.checked_sub(4) { n } else { n }
1111
| ~~~~~~~~~~~~~~~~
1212

13-
error: `dbg!` macro is intended as a debugging tool
13+
error: the `dbg!` macro is intended as a debugging tool
1414
--> $DIR/dbg_macro.rs:9:8
1515
|
1616
LL | if dbg!(n <= 1) {
1717
| ^^^^^^^^^^^^
1818
|
19-
help: ensure to avoid having uses of it in version control
19+
help: remove the invocation before committing it to a version control system
2020
|
2121
LL | if n <= 1 {
2222
| ~~~~~~
2323

24-
error: `dbg!` macro is intended as a debugging tool
24+
error: the `dbg!` macro is intended as a debugging tool
2525
--> $DIR/dbg_macro.rs:10:9
2626
|
2727
LL | dbg!(1)
2828
| ^^^^^^^
2929
|
30-
help: ensure to avoid having uses of it in version control
30+
help: remove the invocation before committing it to a version control system
3131
|
3232
LL | 1
3333
|
3434

35-
error: `dbg!` macro is intended as a debugging tool
35+
error: the `dbg!` macro is intended as a debugging tool
3636
--> $DIR/dbg_macro.rs:12:9
3737
|
3838
LL | dbg!(n * factorial(n - 1))
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
4040
|
41-
help: ensure to avoid having uses of it in version control
41+
help: remove the invocation before committing it to a version control system
4242
|
4343
LL | n * factorial(n - 1)
4444
|
4545

46-
error: `dbg!` macro is intended as a debugging tool
46+
error: the `dbg!` macro is intended as a debugging tool
4747
--> $DIR/dbg_macro.rs:17:5
4848
|
4949
LL | dbg!(42);
5050
| ^^^^^^^^
5151
|
52-
help: ensure to avoid having uses of it in version control
52+
help: remove the invocation before committing it to a version control system
5353
|
5454
LL | 42;
5555
| ~~
5656

57-
error: `dbg!` macro is intended as a debugging tool
57+
error: the `dbg!` macro is intended as a debugging tool
5858
--> $DIR/dbg_macro.rs:18:5
5959
|
6060
LL | dbg!(dbg!(dbg!(42)));
6161
| ^^^^^^^^^^^^^^^^^^^^
6262
|
63-
help: ensure to avoid having uses of it in version control
63+
help: remove the invocation before committing it to a version control system
6464
|
6565
LL | dbg!(dbg!(42));
6666
| ~~~~~~~~~~~~~~
6767

68-
error: `dbg!` macro is intended as a debugging tool
68+
error: the `dbg!` macro is intended as a debugging tool
6969
--> $DIR/dbg_macro.rs:19:14
7070
|
7171
LL | foo(3) + dbg!(factorial(4));
7272
| ^^^^^^^^^^^^^^^^^^
7373
|
74-
help: ensure to avoid having uses of it in version control
74+
help: remove the invocation before committing it to a version control system
7575
|
7676
LL | foo(3) + factorial(4);
7777
| ~~~~~~~~~~~~
7878

79-
error: `dbg!` macro is intended as a debugging tool
79+
error: the `dbg!` macro is intended as a debugging tool
8080
--> $DIR/dbg_macro.rs:20:5
8181
|
8282
LL | dbg!(1, 2, dbg!(3, 4));
8383
| ^^^^^^^^^^^^^^^^^^^^^^
8484
|
85-
help: ensure to avoid having uses of it in version control
85+
help: remove the invocation before committing it to a version control system
8686
|
8787
LL | (1, 2, dbg!(3, 4));
8888
| ~~~~~~~~~~~~~~~~~~
8989

90-
error: `dbg!` macro is intended as a debugging tool
90+
error: the `dbg!` macro is intended as a debugging tool
9191
--> $DIR/dbg_macro.rs:21:5
9292
|
9393
LL | dbg!(1, 2, 3, 4, 5);
9494
| ^^^^^^^^^^^^^^^^^^^
9595
|
96-
help: ensure to avoid having uses of it in version control
96+
help: remove the invocation before committing it to a version control system
9797
|
9898
LL | (1, 2, 3, 4, 5);
9999
| ~~~~~~~~~~~~~~~
100100

101-
error: `dbg!` macro is intended as a debugging tool
101+
error: the `dbg!` macro is intended as a debugging tool
102102
--> $DIR/dbg_macro.rs:41:9
103103
|
104104
LL | dbg!(2);
105105
| ^^^^^^^
106106
|
107-
help: ensure to avoid having uses of it in version control
107+
help: remove the invocation before committing it to a version control system
108108
|
109109
LL | 2;
110110
| ~
111111

112-
error: `dbg!` macro is intended as a debugging tool
112+
error: the `dbg!` macro is intended as a debugging tool
113113
--> $DIR/dbg_macro.rs:47:5
114114
|
115115
LL | dbg!(1);
116116
| ^^^^^^^
117117
|
118-
help: ensure to avoid having uses of it in version control
118+
help: remove the invocation before committing it to a version control system
119119
|
120120
LL | 1;
121121
| ~
122122

123-
error: `dbg!` macro is intended as a debugging tool
123+
error: the `dbg!` macro is intended as a debugging tool
124124
--> $DIR/dbg_macro.rs:52:5
125125
|
126126
LL | dbg!(1);
127127
| ^^^^^^^
128128
|
129-
help: ensure to avoid having uses of it in version control
129+
help: remove the invocation before committing it to a version control system
130130
|
131131
LL | 1;
132132
| ~
133133

134-
error: `dbg!` macro is intended as a debugging tool
134+
error: the `dbg!` macro is intended as a debugging tool
135135
--> $DIR/dbg_macro.rs:58:9
136136
|
137137
LL | dbg!(1);
138138
| ^^^^^^^
139139
|
140-
help: ensure to avoid having uses of it in version control
140+
help: remove the invocation before committing it to a version control system
141141
|
142142
LL | 1;
143143
| ~

0 commit comments

Comments
 (0)