Skip to content

Commit ce9aa3c

Browse files
committed
Auto merge of #2797 - Amanieu:unused_macro2, r=Amanieu
Clean up lints around unused macros
2 parents 5add164 + d55d593 commit ce9aa3c

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
improper_ctypes,
1414
// This lint is renamed but we run CI for old stable rustc so should be here.
1515
redundant_semicolon,
16-
redundant_semicolons
16+
redundant_semicolons,
17+
unused_macros,
18+
unused_macro_rules,
1719
)]
1820
#![cfg_attr(libc_deny_warnings, deny(warnings))]
1921
// Attributes needed when building as part of the standard library

src/macros.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
///
77
/// This allows you to conveniently provide a long list #[cfg]'d blocks of code
88
/// without having to rewrite each clause multiple times.
9-
#[allow(unused_macros)]
109
macro_rules! cfg_if {
1110
// match if/else chains with a final `else`
1211
($(
@@ -62,7 +61,6 @@ macro_rules! cfg_if {
6261
};
6362
}
6463

65-
#[allow(unused_macros, unused_macro_rules)]
6664
macro_rules! s {
6765
($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
6866
s!(it: $(#[$attr])* pub $t $i { $($field)* });
@@ -87,7 +85,6 @@ macro_rules! s {
8785
);
8886
}
8987

90-
#[allow(unused_macros)]
9188
macro_rules! s_no_extra_traits {
9289
($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
9390
s_no_extra_traits!(it: $(#[$attr])* pub $t $i { $($field)* });
@@ -123,7 +120,6 @@ macro_rules! s_no_extra_traits {
123120
);
124121
}
125122

126-
#[allow(unused_macros)]
127123
macro_rules! e {
128124
($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($(
129125
__item! {
@@ -138,7 +134,6 @@ macro_rules! e {
138134
)*);
139135
}
140136

141-
#[allow(unused_macros)]
142137
macro_rules! s_paren {
143138
($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($(
144139
__item! {
@@ -182,7 +177,6 @@ macro_rules! s_paren {
182177
// 'f!' block
183178
cfg_if! {
184179
if #[cfg(libc_const_extern_fn)] {
185-
#[allow(unused_macros)]
186180
macro_rules! f {
187181
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
188182
$($arg:ident: $argty:ty),*
@@ -198,7 +192,6 @@ cfg_if! {
198192
)*)
199193
}
200194

201-
#[allow(unused_macros)]
202195
macro_rules! safe_f {
203196
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
204197
$($arg:ident: $argty:ty),*
@@ -214,7 +207,6 @@ cfg_if! {
214207
)*)
215208
}
216209

217-
#[allow(unused_macros)]
218210
macro_rules! const_fn {
219211
($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
220212
$($arg:ident: $argty:ty),*
@@ -231,7 +223,6 @@ cfg_if! {
231223
}
232224

233225
} else {
234-
#[allow(unused_macros)]
235226
macro_rules! f {
236227
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
237228
$($arg:ident: $argty:ty),*
@@ -247,7 +238,6 @@ cfg_if! {
247238
)*)
248239
}
249240

250-
#[allow(unused_macros)]
251241
macro_rules! safe_f {
252242
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
253243
$($arg:ident: $argty:ty),*
@@ -263,7 +253,6 @@ cfg_if! {
263253
)*)
264254
}
265255

266-
#[allow(unused_macros)]
267256
macro_rules! const_fn {
268257
($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
269258
$($arg:ident: $argty:ty),*
@@ -281,14 +270,12 @@ cfg_if! {
281270
}
282271
}
283272

284-
#[allow(unused_macros)]
285273
macro_rules! __item {
286274
($i:item) => {
287275
$i
288276
};
289277
}
290278

291-
#[allow(unused_macros)]
292279
macro_rules! align_const {
293280
($($(#[$attr:meta])*
294281
pub const $name:ident : $t1:ty
@@ -308,7 +295,6 @@ macro_rules! align_const {
308295
}
309296

310297
// This macro is used to deprecate items that should be accessed via the mach2 crate
311-
#[allow(unused_macros)]
312298
macro_rules! deprecated_mach {
313299
(pub const $id:ident: $ty:ty = $expr:expr;) => {
314300
#[deprecated(
@@ -342,15 +328,13 @@ macro_rules! deprecated_mach {
342328
}
343329
}
344330

345-
#[allow(unused_macros)]
346331
#[cfg(not(libc_ptr_addr_of))]
347332
macro_rules! ptr_addr_of {
348333
($place:expr) => {
349334
&$place
350335
};
351336
}
352337

353-
#[allow(unused_macros)]
354338
#[cfg(libc_ptr_addr_of)]
355339
macro_rules! ptr_addr_of {
356340
($place:expr) => {

0 commit comments

Comments
 (0)