@@ -414,27 +414,14 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
414414 }
415415 }
416416
417- ast:: ItemKind :: Impl ( _, polarity, defaultness, ..) => {
418- if polarity == ast:: ImplPolarity :: Negative {
419- gate_feature_post ! ( & self , optin_builtin_traits,
420- i. span,
421- "negative trait bounds are not yet fully implemented; \
422- use marker types for now") ;
423- }
424-
417+ ast:: ItemKind :: Impl ( _, _, defaultness, ..) => {
425418 if let ast:: Defaultness :: Default = defaultness {
426419 gate_feature_post ! ( & self , specialization,
427420 i. span,
428421 "specialization is unstable" ) ;
429422 }
430423 }
431424
432- ast:: ItemKind :: Trait ( ast:: IsAuto :: Yes , ..) => {
433- gate_feature_post ! ( & self , optin_builtin_traits,
434- i. span,
435- "auto traits are experimental and possibly buggy" ) ;
436- }
437-
438425 ast:: ItemKind :: OpaqueTy ( ..) => {
439426 gate_feature_post ! (
440427 & self ,
@@ -464,11 +451,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
464451 "linking to LLVM intrinsics is experimental" ) ;
465452 }
466453 }
467- ast:: ForeignItemKind :: Ty => {
468- gate_feature_post ! ( & self , extern_types, i. span,
469- "extern types are experimental" ) ;
470- }
471- ast:: ForeignItemKind :: Macro ( ..) => { }
454+ _ => { }
472455 }
473456
474457 visit:: walk_foreign_item ( self , i)
@@ -789,7 +772,11 @@ pub fn check_crate(krate: &ast::Crate,
789772 gate_all ! ( try_blocks, "`try` blocks are unstable" ) ;
790773 gate_all ! ( label_break_value, "labels on blocks are unstable" ) ;
791774 gate_all ! ( box_syntax, "box expression syntax is experimental; you can call `Box::new` instead" ) ;
792-
775+ gate_all ! ( auto_traits, optin_builtin_traits, "auto traits are experimental and possibly buggy" ) ;
776+ gate_all ! (
777+ negative_impls, optin_builtin_traits,
778+ "negative trait bounds are not yet fully implemented; use marker types for now"
779+ ) ;
793780 // To avoid noise about type ascription in common syntax errors,
794781 // only emit if it is the *only* error. (Also check it last.)
795782 if parse_sess. span_diagnostic . err_count ( ) == 0 {
0 commit comments