Skip to content

Commit b2c6f8e

Browse files
committed
libc-test: delete handle_s_macro_no_attrs
Unfortunately does not seem to handle cfg_if well
1 parent eb7be2b commit b2c6f8e

File tree

2 files changed

+1
-26
lines changed
  • libc-test/tests/style_lib
  • src/unix/linux_like/linux/musl/b32/mips

2 files changed

+1
-26
lines changed

libc-test/tests/style_lib/mod.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -242,25 +242,6 @@ impl StyleChecker {
242242
self.state = initial_state;
243243
}
244244

245-
/// If we see a normal s! macro without any attributes we just need
246-
/// to check if there are any duplicates.
247-
fn handle_s_macro_no_attrs(&mut self, item_macro: &syn::ItemMacro) {
248-
let span = item_macro.span();
249-
match self.seen_s_macro_cfgs.get("") {
250-
Some(seen_span) => {
251-
self.error(
252-
"duplicate s! macro".to_string(),
253-
span,
254-
format!("other s! macro"),
255-
(Some(*seen_span), "combine the two".to_string()),
256-
);
257-
}
258-
None => {
259-
self.seen_s_macro_cfgs.insert(String::new(), span);
260-
}
261-
}
262-
}
263-
264245
/// If an s! macro has attributes we check for any duplicates as well
265246
/// as if they are standalone positive cfgs that would be better
266247
/// in a separate file.
@@ -367,9 +348,7 @@ impl<'ast> Visit<'ast> for StyleChecker {
367348
/// instead of [syn::Macro] because it contains the attributes.
368349
fn visit_item_macro(&mut self, item_macro: &'ast syn::ItemMacro) {
369350
if item_macro.mac.path.is_ident("s") {
370-
if item_macro.attrs.is_empty() {
371-
self.handle_s_macro_no_attrs(item_macro);
372-
} else {
351+
if !item_macro.attrs.is_empty() {
373352
self.handle_s_macro_with_attrs(item_macro);
374353
}
375354
}

src/unix/linux_like/linux/musl/b32/mips/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ cfg_if! {
195195
#[cfg(target_endian = "big")]
196196
__msg_ctime_lo: Padding<c_ulong>,
197197

198-
199198
#[cfg(target_endian = "little")]
200199
__msg_stime_lo: Padding<c_ulong>,
201200
#[cfg(target_endian = "little")]
@@ -209,7 +208,6 @@ cfg_if! {
209208
#[cfg(target_endian = "little")]
210209
__msg_ctime_hi: Padding<c_ulong>,
211210

212-
213211
pub __msg_cbytes: c_ulong,
214212
pub msg_qnum: crate::msgqnum_t,
215213
pub msg_qbytes: crate::msglen_t,
@@ -241,7 +239,6 @@ cfg_if! {
241239
#[cfg(target_endian = "big")]
242240
pub msg_ctime: crate::time_t,
243241

244-
245242
#[cfg(target_endian = "little")]
246243
pub msg_stime: crate::time_t,
247244
#[cfg(target_endian = "little")]
@@ -255,7 +252,6 @@ cfg_if! {
255252
#[cfg(target_endian = "little")]
256253
__unused3: Padding<c_int>,
257254

258-
259255
pub __msg_cbytes: c_ulong,
260256
pub msg_qnum: crate::msgqnum_t,
261257
pub msg_qbytes: crate::msglen_t,

0 commit comments

Comments
 (0)