@@ -414,27 +414,14 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
414
414
}
415
415
}
416
416
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, ..) => {
425
418
if let ast:: Defaultness :: Default = defaultness {
426
419
gate_feature_post ! ( & self , specialization,
427
420
i. span,
428
421
"specialization is unstable" ) ;
429
422
}
430
423
}
431
424
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
-
438
425
ast:: ItemKind :: OpaqueTy ( ..) => {
439
426
gate_feature_post ! (
440
427
& self ,
@@ -464,11 +451,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
464
451
"linking to LLVM intrinsics is experimental" ) ;
465
452
}
466
453
}
467
- ast:: ForeignItemKind :: Ty => {
468
- gate_feature_post ! ( & self , extern_types, i. span,
469
- "extern types are experimental" ) ;
470
- }
471
- ast:: ForeignItemKind :: Macro ( ..) => { }
454
+ _ => { }
472
455
}
473
456
474
457
visit:: walk_foreign_item ( self , i)
@@ -789,7 +772,11 @@ pub fn check_crate(krate: &ast::Crate,
789
772
gate_all ! ( try_blocks, "`try` blocks are unstable" ) ;
790
773
gate_all ! ( label_break_value, "labels on blocks are unstable" ) ;
791
774
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
+ ) ;
793
780
// To avoid noise about type ascription in common syntax errors,
794
781
// only emit if it is the *only* error. (Also check it last.)
795
782
if parse_sess. span_diagnostic . err_count ( ) == 0 {
0 commit comments