about summary refs log tree commit diff
path: root/compiler/rustc_feature/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-30 12:05:48 +0000
committerbors <bors@rust-lang.org>2021-07-30 12:05:48 +0000
commit87dc8242484110c75596a91ebd2043a476c09839 (patch)
tree00eb86f03f25d8707dd1784052d813dcc4cb0803 /compiler/rustc_feature/src
parent1195bea5a7b73e079fa14b37ac7e375fc77d368a (diff)
parentc5a29f92450c5d1191754000d37611af5e19f38b (diff)
downloadrust-87dc8242484110c75596a91ebd2043a476c09839.tar.gz
rust-87dc8242484110c75596a91ebd2043a476c09839.zip
Auto merge of #87237 - jonas-schievink:const-for-and-try, r=oli-obk
Add feature gates for `for` and `?` in consts

These operations seems *relatively* straightforward to support, and only seem to be blocked on `impl const Trait`.

I have included a working test for `const_try`, but `const_for` is currently unusable without reimplementing *every single* defaulted `Iterator` method, so I didn't do that.

(both features still need tracking issues before this is merged)
Diffstat (limited to 'compiler/rustc_feature/src')
-rw-r--r--compiler/rustc_feature/src/active.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index bf99d298817..1ec9a0518b8 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -677,6 +677,12 @@ declare_features! (
     /// Allows `#[derive(Default)]` and `#[default]` on enums.
     (active, derive_default_enum, "1.56.0", Some(86985), None),
 
+    /// Allows `for _ in _` loops in const contexts.
+    (active, const_for, "1.56.0", Some(87575), None),
+
+    /// Allows the `?` operator in const contexts.
+    (active, const_try, "1.56.0", Some(74935), None),
+
     // -------------------------------------------------------------------------
     // feature-group-end: actual feature gates
     // -------------------------------------------------------------------------