]> git.lizzy.rs Git - rust.git/commitdiff
Use the correct allow
authorJohn Renner <john@jrenner.net>
Wed, 1 Aug 2018 19:33:10 +0000 (12:33 -0700)
committerJohn Renner <john@jrenner.net>
Wed, 1 Aug 2018 19:33:10 +0000 (12:33 -0700)
src/libsyntax/ext/expand.rs

index 590d8cd6c99f4ece019ddc934a918dffd44f95dd..7a9422ef53d58d06802b83e433c65edfacb7f107 100644 (file)
@@ -1376,7 +1376,7 @@ fn fold_item(&mut self, item: P<ast::Item>) -> SmallVector<P<ast::Item>> {
             // #[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)) {
@@ -1398,12 +1398,12 @@ fn fold_item(&mut self, item: P<ast::Item>) -> SmallVector<P<ast::Item>> {
                         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"))
                                 ]
                             ))
                         );