about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-26 18:41:38 +0000
committerbors <bors@rust-lang.org>2018-03-26 18:41:38 +0000
commit188e693b392116c46f746e86f8521f9621fcfd43 (patch)
tree21205e49317c0c351e2ef53a584559a213e862b8 /src/libsyntax
parentab8b961677ac5c74762dcea955aa0ff4d7fe4915 (diff)
parent140bf949bf65bb0479dbe31bd3474d5546ef59e1 (diff)
downloadrust-188e693b392116c46f746e86f8521f9621fcfd43.tar.gz
rust-188e693b392116c46f746e86f8521f9621fcfd43.zip
Auto merge of #49101 - mark-i-m:stabilize_i128, r=nagisa
Stabilize 128-bit integers :tada:

cc #35118

EDIT: This should be merged only after the following have been merged:
- [x] https://github.com/rust-lang-nursery/compiler-builtins/pull/236
- [x] https://github.com/rust-lang/book/pull/1230
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/diagnostic_list.rs12
-rw-r--r--src/libsyntax/feature_gate.rs17
-rw-r--r--src/libsyntax/lib.rs2
3 files changed, 11 insertions, 20 deletions
diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs
index 1f87c1b94c5..bb7988e64bc 100644
--- a/src/libsyntax/diagnostic_list.rs
+++ b/src/libsyntax/diagnostic_list.rs
@@ -250,7 +250,10 @@ An unstable feature was used.
 Erroneous code example:
 
 ```compile_fail,E658
-let x = ::std::u128::MAX; // error: use of unstable library feature 'i128'
+#[repr(u128)] // error: use of unstable library feature 'repr128'
+enum Foo {
+    Bar(u64),
+}
 ```
 
 If you're using a stable or a beta version of rustc, you won't be able to use
@@ -261,10 +264,11 @@ If you're using a nightly version of rustc, just add the corresponding feature
 to be able to use it:
 
 ```
-#![feature(i128)]
+#![feature(repr128)]
 
-fn main() {
-    let x = ::std::u128::MAX; // ok!
+#[repr(u128)] // ok!
+enum Foo {
+    Bar(u64),
 }
 ```
 "##,
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 1bb369b551d..4e3c77d5e46 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -303,9 +303,6 @@ declare_features! (
     // `extern "ptx-*" fn()`
     (active, abi_ptx, "1.15.0", None, None),
 
-    // The `i128` type
-    (active, i128_type, "1.16.0", Some(35118), None),
-
     // The `repr(i128)` annotation for enums
     (active, repr128, "1.16.0", Some(35118), None),
 
@@ -564,6 +561,8 @@ declare_features! (
     (accepted, universal_impl_trait, "1.26.0", Some(34511), None),
     // Allows `impl Trait` in function return types.
     (accepted, conservative_impl_trait, "1.26.0", Some(34511), None),
+    // The `i128` type
+    (accepted, i128_type, "1.26.0", Some(35118), None),
 );
 
 // If you change this, please modify src/doc/unstable-book as well. You must
@@ -1641,18 +1640,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                                   e.span,
                                   "yield syntax is experimental");
             }
-            ast::ExprKind::Lit(ref lit) => {
-                if let ast::LitKind::Int(_, ref ty) = lit.node {
-                    match *ty {
-                        ast::LitIntType::Signed(ast::IntTy::I128) |
-                        ast::LitIntType::Unsigned(ast::UintTy::U128) => {
-                            gate_feature_post!(&self, i128_type, e.span,
-                                               "128-bit integers are not stable");
-                        }
-                        _ => {}
-                    }
-                }
-            }
             ast::ExprKind::Catch(_) => {
                 gate_feature_post!(&self, catch_expr, e.span, "`catch` expression is experimental");
             }
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 74f1ee373ec..2218b396685 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -24,7 +24,7 @@
 #![feature(rustc_diagnostic_macros)]
 #![feature(match_default_bindings)]
 #![feature(non_exhaustive)]
-#![feature(i128_type)]
+#![cfg_attr(stage0, feature(i128_type))]
 #![feature(const_atomic_usize_new)]
 #![feature(rustc_attrs)]