diff options
| author | bors <bors@rust-lang.org> | 2015-09-19 21:19:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-19 21:19:29 +0000 |
| commit | 783c3fcc1ec19a804a63334d1945301fe89c52f6 (patch) | |
| tree | d775ac4e2ee5b0a8d8c64786a6cef4d7b1407e32 /src/libsyntax | |
| parent | 837840c61fce44da78096110ff83c91099a83da7 (diff) | |
| parent | f5569ecd7682a22f9ae3293a89479c7b99b6d941 (diff) | |
| download | rust-783c3fcc1ec19a804a63334d1945301fe89c52f6.tar.gz rust-783c3fcc1ec19a804a63334d1945301fe89c52f6.zip | |
Auto merge of #28345 - japaric:op-assign, r=nmatsakis
Implements overload-able augmented/compound assignments, like `a += b` via the `AddAssign` trait, as specified in RFC [953] [953]: https://github.com/rust-lang/rfcs/blob/master/text/0953-op-assign.md r? @nikomatsakis
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 989977a6917..1e9b244c57c 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -194,6 +194,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Option<u32>, Status // allow empty structs/enum variants with braces ("braced_empty_structs", "1.5.0", None, Active), + + // allow overloading augmented assignment operations like `a += b` + ("augmented_assignments", "1.5.0", None, Active), ]; // (changing above list without updating src/doc/reference.md makes @cmr sad) @@ -457,6 +460,7 @@ pub struct Features { pub default_type_parameter_fallback: bool, pub type_macros: bool, pub cfg_target_feature: bool, + pub augmented_assignments: bool, } impl Features { @@ -485,6 +489,7 @@ impl Features { default_type_parameter_fallback: false, type_macros: false, cfg_target_feature: false, + augmented_assignments: false, } } } @@ -1053,6 +1058,7 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler, default_type_parameter_fallback: cx.has_feature("default_type_parameter_fallback"), type_macros: cx.has_feature("type_macros"), cfg_target_feature: cx.has_feature("cfg_target_feature"), + augmented_assignments: cx.has_feature("augmented_assignments"), } } |
