summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-03-04 18:10:54 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-03-06 00:18:29 +1100
commit10426f69dac38186c7bb8946743023729d65e1e6 (patch)
tree9ccb440e47bb213f9ea0a1a861a2e42000d85332 /src/libsyntax
parentab7ef7402bfab1c767b8be80f7e46947494f6d21 (diff)
downloadrust-10426f69dac38186c7bb8946743023729d65e1e6.tar.gz
rust-10426f69dac38186c7bb8946743023729d65e1e6.zip
Add more debugging to syntax::feature_gate.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 3b2d86cffe2..bc955259ab5 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -285,7 +285,7 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
     ("recursion_limit", CrateLevel),
 ];
 
-#[derive(PartialEq, Copy)]
+#[derive(PartialEq, Copy, Debug)]
 pub enum AttributeType {
     /// Normal, builtin attribute that is consumed
     /// by the compiler before the unused_attribute check
@@ -353,7 +353,9 @@ struct Context<'a> {
 
 impl<'a> Context<'a> {
     fn gate_feature(&self, feature: &str, span: Span, explain: &str) {
-        if !self.has_feature(feature) {
+        let has_feature = self.has_feature(feature);
+        debug!("gate_feature(feature = {:?}, span = {:?}); has? {}", feature, span, has_feature);
+        if !has_feature {
             emit_feature_err(self.span_handler, feature, span, explain);
         }
     }
@@ -634,12 +636,14 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
     }
 
     fn visit_attribute(&mut self, attr: &ast::Attribute) {
+        debug!("visit_attribute(attr = {:?})", attr);
         let name = &*attr.name();
         for &(n, ty) in KNOWN_ATTRIBUTES {
             if n == name {
                 if let Gated(gate, desc) = ty {
                     self.gate_feature(gate, attr.span, desc);
                 }
+                debug!("visit_attribute: {:?} is known, {:?}", name, ty);
                 return;
             }
         }