Skip to content

Commit bd8a0cf

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

File tree

1 file changed

+1
-22
lines changed
  • libc-test/tests/style_lib

1 file changed

+1
-22
lines changed

libc-test/tests/style_lib/mod.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -229,25 +229,6 @@ impl StyleChecker {
229229
self.state = initial_state;
230230
}
231231

232-
/// If we see a normal s! macro without any attributes we just need
233-
/// to check if there are any duplicates.
234-
fn handle_s_macro_no_attrs(&mut self, item_macro: &syn::ItemMacro) {
235-
let span = item_macro.span();
236-
match self.seen_s_macro_cfgs.get("") {
237-
Some(seen_span) => {
238-
self.error(
239-
"duplicate s! macro".to_string(),
240-
span,
241-
format!("other s! macro"),
242-
(Some(*seen_span), "combine the two".to_string()),
243-
);
244-
}
245-
None => {
246-
self.seen_s_macro_cfgs.insert(String::new(), span);
247-
}
248-
}
249-
}
250-
251232
/// If an s! macro has attributes we check for any duplicates as well
252233
/// as if they are standalone positive cfgs that would be better
253234
/// in a separate file.
@@ -354,9 +335,7 @@ impl<'ast> Visit<'ast> for StyleChecker {
354335
/// instead of [syn::Macro] because it contains the attributes.
355336
fn visit_item_macro(&mut self, item_macro: &'ast syn::ItemMacro) {
356337
if item_macro.mac.path.is_ident("s") {
357-
if item_macro.attrs.is_empty() {
358-
self.handle_s_macro_no_attrs(item_macro);
359-
} else {
338+
if !item_macro.attrs.is_empty() {
360339
self.handle_s_macro_with_attrs(item_macro);
361340
}
362341
}

0 commit comments

Comments
 (0)