From d8e309320d55e08f5bbda2f18b20a3a64198061e Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Wed, 1 Apr 2015 01:32:41 +0200 Subject: added unary_negate feature gate. --- src/libsyntax/feature_gate.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index f88381fb36f..adcef07e190 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -150,6 +150,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // #23121. Array patterns have some hazards yet. ("slice_patterns", "1.0.0", Active), + + // Allows use of unary negate on unsigned integers, e.g. -e for e: u8 + ("negate_unsigned", "1.0.0", Active), ]; // (changing above list without updating src/doc/reference.md makes @cmr sad) @@ -319,6 +322,7 @@ pub struct Features { pub allow_custom_derive: bool, pub simd_ffi: bool, pub unmarked_api: bool, + pub negate_unsigned: bool, /// spans of #![feature] attrs for stable language features. for error reporting pub declared_stable_lang_features: Vec, /// #![feature] attrs for non-language (library) features @@ -340,6 +344,7 @@ impl Features { allow_custom_derive: false, simd_ffi: false, unmarked_api: false, + negate_unsigned: false, declared_stable_lang_features: Vec::new(), declared_lib_features: Vec::new() } @@ -712,6 +717,7 @@ fn check_crate_inner(cm: &CodeMap, span_handler: &SpanHandler, allow_custom_derive: cx.has_feature("custom_derive"), simd_ffi: cx.has_feature("simd_ffi"), unmarked_api: cx.has_feature("unmarked_api"), + negate_unsigned: cx.has_feature("negate_unsigned"), declared_stable_lang_features: accepted_features, declared_lib_features: unknown_features } -- cgit 1.4.1-3-g733a5