Skip to content

Commit 064aa5a

Browse files
committed
Reword lint message
1 parent da703dd commit 064aa5a

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

clippy_lints/src/macro_metavars_in_unsafe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl<'tcx> LateLintPass<'tcx> for ExprMetavarsInUnsafe {
240240
MACRO_METAVARS_IN_UNSAFE,
241241
id,
242242
span,
243-
"this unsafe block in a macro expands metavariables",
243+
"this macro expands metavariables in an unsafe block",
244244
|diag| {
245245
diag.note("this allows the user of the macro to write unsafe code outside of an unsafe block");
246246
diag.help(

tests/ui-toml/macro_metavars_in_unsafe/default/test.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ macro_rules! allow_works {
1717
macro_rules! simple {
1818
($v:expr) => {
1919
unsafe {
20-
//~^ ERROR: this unsafe block in a macro expands metavariables
20+
//~^ ERROR: this macro expands metavariables in an unsafe block
2121
dbg!($v);
2222
}
2323
};
@@ -28,7 +28,7 @@ macro_rules! simple {
2828
macro_rules! raw_symbol {
2929
($r#mod:expr, $r#unsafe:expr) => {
3030
unsafe {
31-
//~^ ERROR: this unsafe block in a macro expands metavariables
31+
//~^ ERROR: this macro expands metavariables in an unsafe block
3232
$r#mod;
3333
}
3434
$r#unsafe;
@@ -40,7 +40,7 @@ macro_rules! multilevel_unsafe {
4040
($v:expr) => {
4141
unsafe {
4242
unsafe {
43-
//~^ ERROR: this unsafe block in a macro expands metavariables
43+
//~^ ERROR: this macro expands metavariables in an unsafe block
4444
$v;
4545
}
4646
}
@@ -65,7 +65,7 @@ macro_rules! in_function_with_unsafe {
6565
unsafe {
6666
fn f() {
6767
unsafe {
68-
//~^ ERROR: this unsafe block in a macro expands metavariables
68+
//~^ ERROR: this macro expands metavariables in an unsafe block
6969
$v;
7070
}
7171
}
@@ -93,7 +93,7 @@ macro_rules! const_generic_in_struct {
9393
const M: i32 = {
9494
1;
9595
unsafe { $inside_unsafe }
96-
//~^ ERROR: this unsafe block in a macro expands metavariables
96+
//~^ ERROR: this macro expands metavariables in an unsafe block
9797
},
9898
const N: i32 = { $outside_unsafe },
9999
>;
@@ -108,7 +108,7 @@ macro_rules! fn_with_const_generic {
108108
fn f<const N: usize>() {
109109
$outside_unsafe;
110110
unsafe {
111-
//~^ ERROR: this unsafe block in a macro expands metavariables
111+
//~^ ERROR: this macro expands metavariables in an unsafe block
112112
$inside_unsafe;
113113
}
114114
}
@@ -120,7 +120,7 @@ macro_rules! fn_with_const_generic {
120120
macro_rules! variables {
121121
($inside_unsafe:expr, $outside_unsafe:expr) => {
122122
unsafe {
123-
//~^ ERROR: this unsafe block in a macro expands metavariables
123+
//~^ ERROR: this macro expands metavariables in an unsafe block
124124
$inside_unsafe;
125125
let inside_unsafe = 1;
126126
inside_unsafe;
@@ -135,7 +135,7 @@ macro_rules! variables {
135135
macro_rules! multiple_matchers {
136136
($inside_unsafe:expr, $outside_unsafe:expr) => {
137137
unsafe {
138-
//~^ ERROR: this unsafe block in a macro expands metavariables
138+
//~^ ERROR: this macro expands metavariables in an unsafe block
139139
$inside_unsafe;
140140
}
141141
$outside_unsafe;
@@ -144,7 +144,7 @@ macro_rules! multiple_matchers {
144144
$(
145145
$v;
146146
unsafe {
147-
//~^ ERROR: this unsafe block in a macro expands metavariables
147+
//~^ ERROR: this macro expands metavariables in an unsafe block
148148
$x;
149149
}
150150
);+
@@ -156,11 +156,11 @@ macro_rules! multiple_unsafe_blocks {
156156
($w:expr, $x:expr, $y:expr) => {
157157
$w;
158158
unsafe {
159-
//~^ ERROR: this unsafe block in a macro expands metavariables
159+
//~^ ERROR: this macro expands metavariables in an unsafe block
160160
$x;
161161
}
162162
unsafe {
163-
//~^ ERROR: this unsafe block in a macro expands metavariables
163+
//~^ ERROR: this macro expands metavariables in an unsafe block
164164
$x;
165165
$y;
166166
}
@@ -169,7 +169,7 @@ macro_rules! multiple_unsafe_blocks {
169169

170170
pub macro macro2_0($v:expr) {
171171
unsafe {
172-
//~^ ERROR: this unsafe block in a macro expands metavariables
172+
//~^ ERROR: this macro expands metavariables in an unsafe block
173173
$v;
174174
}
175175
}
@@ -220,7 +220,7 @@ macro_rules! unsafe_from_root_ctxt {
220220
macro_rules! nested_macro_helper {
221221
($v:expr) => {{
222222
unsafe {
223-
//~^ ERROR: this unsafe block in a macro expands metavariables
223+
//~^ ERROR: this macro expands metavariables in an unsafe block
224224
$v;
225225
}
226226
}};
@@ -230,7 +230,7 @@ macro_rules! nested_macro_helper {
230230
macro_rules! nested_macros {
231231
($v:expr, $v2:expr) => {{
232232
unsafe {
233-
//~^ ERROR: this unsafe block in a macro expands metavariables
233+
//~^ ERROR: this macro expands metavariables in an unsafe block
234234
nested_macro_helper!($v);
235235
$v;
236236
}

tests/ui-toml/macro_metavars_in_unsafe/default/test.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: this unsafe block in a macro expands metavariables
1+
error: this macro expands metavariables in an unsafe block
22
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:19:9
33
|
44
LL | / unsafe {
@@ -13,7 +13,7 @@ LL | | }
1313
= note: `-D clippy::macro-metavars-in-unsafe` implied by `-D warnings`
1414
= help: to override `-D warnings` add `#[allow(clippy::macro_metavars_in_unsafe)]`
1515

16-
error: this unsafe block in a macro expands metavariables
16+
error: this macro expands metavariables in an unsafe block
1717
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:30:9
1818
|
1919
LL | / unsafe {
@@ -26,7 +26,7 @@ LL | | }
2626
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
2727
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
2828

29-
error: this unsafe block in a macro expands metavariables
29+
error: this macro expands metavariables in an unsafe block
3030
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:42:13
3131
|
3232
LL | / unsafe {
@@ -39,7 +39,7 @@ LL | | }
3939
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
4040
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
4141

42-
error: this unsafe block in a macro expands metavariables
42+
error: this macro expands metavariables in an unsafe block
4343
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:67:17
4444
|
4545
LL | / unsafe {
@@ -52,7 +52,7 @@ LL | | }
5252
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
5353
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
5454

55-
error: this unsafe block in a macro expands metavariables
55+
error: this macro expands metavariables in an unsafe block
5656
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:95:21
5757
|
5858
LL | unsafe { $inside_unsafe }
@@ -62,7 +62,7 @@ LL | unsafe { $inside_unsafe }
6262
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
6363
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
6464

65-
error: this unsafe block in a macro expands metavariables
65+
error: this macro expands metavariables in an unsafe block
6666
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:110:17
6767
|
6868
LL | / unsafe {
@@ -75,7 +75,7 @@ LL | | }
7575
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
7676
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
7777

78-
error: this unsafe block in a macro expands metavariables
78+
error: this macro expands metavariables in an unsafe block
7979
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:122:9
8080
|
8181
LL | / unsafe {
@@ -90,7 +90,7 @@ LL | | }
9090
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
9191
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
9292

93-
error: this unsafe block in a macro expands metavariables
93+
error: this macro expands metavariables in an unsafe block
9494
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:137:9
9595
|
9696
LL | / unsafe {
@@ -103,7 +103,7 @@ LL | | }
103103
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
104104
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
105105

106-
error: this unsafe block in a macro expands metavariables
106+
error: this macro expands metavariables in an unsafe block
107107
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:146:13
108108
|
109109
LL | / unsafe {
@@ -116,7 +116,7 @@ LL | | }
116116
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
117117
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
118118

119-
error: this unsafe block in a macro expands metavariables
119+
error: this macro expands metavariables in an unsafe block
120120
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:171:5
121121
|
122122
LL | / unsafe {
@@ -129,7 +129,7 @@ LL | | }
129129
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
130130
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
131131

132-
error: this unsafe block in a macro expands metavariables
132+
error: this macro expands metavariables in an unsafe block
133133
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:158:9
134134
|
135135
LL | / unsafe {
@@ -142,7 +142,7 @@ LL | | }
142142
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
143143
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
144144

145-
error: this unsafe block in a macro expands metavariables
145+
error: this macro expands metavariables in an unsafe block
146146
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:162:9
147147
|
148148
LL | / unsafe {
@@ -156,7 +156,7 @@ LL | | }
156156
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
157157
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
158158

159-
error: this unsafe block in a macro expands metavariables
159+
error: this macro expands metavariables in an unsafe block
160160
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:222:9
161161
|
162162
LL | / unsafe {
@@ -169,7 +169,7 @@ LL | | }
169169
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
170170
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
171171

172-
error: this unsafe block in a macro expands metavariables
172+
error: this macro expands metavariables in an unsafe block
173173
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:232:9
174174
|
175175
LL | / unsafe {

tests/ui-toml/macro_metavars_in_unsafe/private/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
macro_rules! mac {
55
($v:expr) => {
66
unsafe {
7-
//~^ ERROR: this unsafe block in a macro expands metavariables
7+
//~^ ERROR: this macro expands metavariables in an unsafe block
88
dbg!($v);
99
}
1010
};

tests/ui-toml/macro_metavars_in_unsafe/private/test.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: this unsafe block in a macro expands metavariables
1+
error: this macro expands metavariables in an unsafe block
22
--> tests/ui-toml/macro_metavars_in_unsafe/private/test.rs:6:9
33
|
44
LL | / unsafe {

0 commit comments

Comments
 (0)