]> git.lizzy.rs Git - rust.git/commitdiff
Allow attributes to be marked used before `cfg` proccessing.
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Fri, 12 Aug 2016 08:15:40 +0000 (08:15 +0000)
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Sat, 13 Aug 2016 20:08:42 +0000 (20:08 +0000)
src/librustc_passes/ast_validation.rs

index 341c9d820e6519b060445ec621a56a3cc49faee4..2d7aab1b4557f11bbaf30e3f9953db6df3749e63 100644 (file)
@@ -19,6 +19,7 @@
 use rustc::lint;
 use rustc::session::Session;
 use syntax::ast::*;
+use syntax::attr;
 use syntax::parse::token::{self, keywords};
 use syntax::visit::{self, Visitor};
 use syntax_pos::Span;
@@ -168,6 +169,10 @@ fn visit_item(&mut self, item: &Item) {
                     }
                 }
             }
+            ItemKind::Mod(_) => {
+                // Ensure that `path` attributes on modules are recorded as used (c.f. #35584).
+                attr::first_attr_value_str_by_name(&item.attrs, "path");
+            }
             _ => {}
         }