@@ -285,7 +285,7 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
285
285
( "recursion_limit" , CrateLevel ) ,
286
286
] ;
287
287
288
- #[ derive( PartialEq , Copy ) ]
288
+ #[ derive( PartialEq , Copy , Debug ) ]
289
289
pub enum AttributeType {
290
290
/// Normal, builtin attribute that is consumed
291
291
/// by the compiler before the unused_attribute check
@@ -353,7 +353,9 @@ struct Context<'a> {
353
353
354
354
impl < ' a > Context < ' a > {
355
355
fn gate_feature ( & self , feature : & str , span : Span , explain : & str ) {
356
- if !self . has_feature ( feature) {
356
+ let has_feature = self . has_feature ( feature) ;
357
+ debug ! ( "gate_feature(feature = {:?}, span = {:?}); has? {}" , feature, span, has_feature) ;
358
+ if !has_feature {
357
359
emit_feature_err ( self . span_handler , feature, span, explain) ;
358
360
}
359
361
}
@@ -634,12 +636,14 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
634
636
}
635
637
636
638
fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
639
+ debug ! ( "visit_attribute(attr = {:?})" , attr) ;
637
640
let name = & * attr. name ( ) ;
638
641
for & ( n, ty) in KNOWN_ATTRIBUTES {
639
642
if n == name {
640
643
if let Gated ( gate, desc) = ty {
641
644
self . gate_feature ( gate, attr. span , desc) ;
642
645
}
646
+ debug ! ( "visit_attribute: {:?} is known, {:?}" , name, ty) ;
643
647
return ;
644
648
}
645
649
}
0 commit comments