about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-08-12 08:15:40 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-08-13 20:08:42 +0000
commitb08043ee69d45ebe048d1a3d48bce8c52ccffc60 (patch)
tree20448fcc8c7e0774b1ae5891c9ffca1522832bf5 /src
parent8787a12334439d47e931be26fef53381ce337c3a (diff)
downloadrust-b08043ee69d45ebe048d1a3d48bce8c52ccffc60.tar.gz
rust-b08043ee69d45ebe048d1a3d48bce8c52ccffc60.zip
Allow attributes to be marked used before `cfg` proccessing.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_passes/ast_validation.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs
index 341c9d820e6..2d7aab1b455 100644
--- a/src/librustc_passes/ast_validation.rs
+++ b/src/librustc_passes/ast_validation.rs
@@ -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 @@ impl<'a> Visitor for AstValidator<'a> {
                     }
                 }
             }
+            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");
+            }
             _ => {}
         }