@@ -53,7 +53,7 @@ use syntax::{abi, ast};
53
53
use syntax:: ast_util:: { self , is_shift_binop, local_def} ;
54
54
use syntax:: attr:: { self , AttrMetaMethods } ;
55
55
use syntax:: codemap:: { self , Span } ;
56
- use syntax:: feature_gate:: { KNOWN_ATTRIBUTES , AttributeType , emit_feature_err } ;
56
+ use syntax:: feature_gate:: { KNOWN_ATTRIBUTES , AttributeType } ;
57
57
use syntax:: parse:: token;
58
58
use syntax:: ast:: { TyIs , TyUs , TyI8 , TyU8 , TyI16 , TyU16 , TyI32 , TyU32 , TyI64 , TyU64 } ;
59
59
use syntax:: ptr:: P ;
@@ -382,11 +382,13 @@ impl LintPass for TypeLimits {
382
382
383
383
fn check_unsigned_negation_feature ( cx : & Context , span : Span ) {
384
384
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") ;
390
392
}
391
393
}
392
394
}
0 commit comments