@@ -53,7 +53,7 @@ use syntax::{abi, ast};
5353use syntax:: ast_util:: { self , is_shift_binop, local_def} ;
5454use syntax:: attr:: { self , AttrMetaMethods } ;
5555use syntax:: codemap:: { self , Span } ;
56- use syntax:: feature_gate:: { KNOWN_ATTRIBUTES , AttributeType , emit_feature_err } ;
56+ use syntax:: feature_gate:: { KNOWN_ATTRIBUTES , AttributeType } ;
5757use syntax:: parse:: token;
5858use syntax:: ast:: { TyIs , TyUs , TyI8 , TyU8 , TyI16 , TyU16 , TyI32 , TyU32 , TyI64 , TyU64 } ;
5959use syntax:: ptr:: P ;
@@ -382,11 +382,13 @@ impl LintPass for TypeLimits {
382382
383383 fn check_unsigned_negation_feature ( cx : & Context , span : Span ) {
384384 if !cx. sess ( ) . features . borrow ( ) . negate_unsigned {
385- emit_feature_err (
386- & cx. sess ( ) . parse_sess . span_diagnostic ,
387- "negate_unsigned" ,
388- span,
389- "unary negation of unsigned integers may be removed in the future" ) ;
385+ // FIXME(#27141): change this to syntax::feature_gate::emit_feature_err…
386+ cx. sess ( ) . span_warn ( span,
387+ "unary negation of unsigned integers will be feature gated in the future" ) ;
388+ // …and remove following two expressions.
389+ if option_env ! ( "CFG_DISABLE_UNSTABLE_FEATURES" ) . is_some ( ) { return ; }
390+ cx. sess ( ) . fileline_help ( span, "add #![feature(negate_unsigned)] to the \
391+ crate attributes to enable the gate in advance") ;
390392 }
391393 }
392394 }
0 commit comments