summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-04-20 17:07:58 +0200
committerAlex Crichton <alex@alexcrichton.com>2018-04-21 17:05:10 -0700
commit1bc69894fc86e7a0b2bdcdda05f04ff1897bc640 (patch)
tree21c7cf7735472bf2c4384bc85ddf3e3c58729d9b /src/libsyntax
parentbbfc486d112a9e601f6b1afeb7660c8ba015c849 (diff)
downloadrust-1bc69894fc86e7a0b2bdcdda05f04ff1897bc640.tar.gz
rust-1bc69894fc86e7a0b2bdcdda05f04ff1897bc640.zip
Revert stabilization of `feature(never_type)`.
This commit is just covering the feature gate itself and the tests
that made direct use of `!` and thus need to opt back into the
feature.

A follow on commit brings back the other change that motivates the
revert: Namely, going back to the old rules for falling back to `()`.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 25b392433ec..2291add0c51 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -276,6 +276,9 @@ declare_features! (
     // Allows cfg(target_has_atomic = "...").
     (active, cfg_target_has_atomic, "1.9.0", Some(32976), None),
 
+    // The `!` type. Does not imply exhaustive_patterns (below) any more.
+    (active, never_type, "1.13.0", Some(35121), None),
+
     // Allows exhaustive pattern matching on types that contain uninhabited types.
     (active, exhaustive_patterns, "1.13.0", None, None),
 
@@ -1604,6 +1607,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
             ast::TyKind::BareFn(ref bare_fn_ty) => {
                 self.check_abi(bare_fn_ty.abi, ty.span);
             }
+            ast::TyKind::Never => {
+                gate_feature_post!(&self, never_type, ty.span,
+                                   "The `!` type is experimental");
+            }
             ast::TyKind::TraitObject(_, ast::TraitObjectSyntax::Dyn) => {
                 gate_feature_post!(&self, dyn_trait, ty.span,
                                    "`dyn Trait` syntax is unstable");