Skip to content

Commit

Permalink
Use the correct allow
Browse files Browse the repository at this point in the history
  • Loading branch information
djrenren committed Aug 1, 2018
1 parent af7ae2f commit 77f9aca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libsyntax/ext/expand.rs
Expand Up @@ -1376,7 +1376,7 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> {
// #[test] fn foo() {}
// becomes:
// #[test] pub fn foo_gensym(){}
// #[allow(dead_code)]
// #[allow(unused)]
// use foo_gensym as foo;
ast::ItemKind::Fn(..) if self.cx.ecfg.should_test => {
if self.tests_nameable && item.attrs.iter().any(|attr| is_test_or_bench(attr)) {
Expand All @@ -1398,12 +1398,12 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> {
self.cx.path(item.ident.span,
vec![keywords::SelfValue.ident(), item.ident]));

// #[allow(dead_code)] because the test function probably isn't being referenced
// #[allow(unused)] because the test function probably isn't being referenced
use_item = use_item.map(|mut ui| {
ui.attrs.push(
self.cx.attribute(DUMMY_SP, attr::mk_list_item(DUMMY_SP,
Ident::from_str("allow"), vec![
attr::mk_nested_word_item(Ident::from_str("dead_code"))
attr::mk_nested_word_item(Ident::from_str("unused"))
]
))
);
Expand Down

0 comments on commit 77f9aca

Please sign in to comment.