diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-04-01 01:32:41 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-04-01 22:34:26 +0200 |
| commit | d8e309320d55e08f5bbda2f18b20a3a64198061e (patch) | |
| tree | cac34b14bcbbdcbbfda8714d6d9ba68062570e98 /src/libsyntax | |
| parent | d528aa9960cb9b937d8ef6c09905a6a8076d5f3a (diff) | |
| download | rust-d8e309320d55e08f5bbda2f18b20a3a64198061e.tar.gz rust-d8e309320d55e08f5bbda2f18b20a3a64198061e.zip | |
added unary_negate feature gate.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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<Span>, /// #![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<F>(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 } |
