Skip to content

Commit

Permalink
Stabilize i128 feature too
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Mar 26, 2018
1 parent 33d9d8e commit db7d9ea
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/doc/unstable-book/src/language-features/i128-type.md
Expand Up @@ -9,7 +9,7 @@ The tracking issue for this feature is: [#35118]
The `i128` feature adds support for `#[repr(u128)]` on `enum`s.

```rust
#![feature(i128)]
#![feature(repri128)]

#[repr(u128)]
enum Foo {
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/num/i128.rs
Expand Up @@ -12,6 +12,6 @@
//!
//! *[See also the `i128` primitive type](../../std/primitive.i128.html).*

#![unstable(feature = "i128", issue="35118")]
#![stable(feature = "i128", since = "1.26.0")]

int_module! { i128, #[unstable(feature = "i128", issue="35118")] }
int_module! { i128, #[stable(feature = "i128", since="1.26.0")] }
11 changes: 2 additions & 9 deletions src/libcore/num/mod.rs
Expand Up @@ -1635,10 +1635,7 @@ impl i64 {
#[lang = "i128"]
impl i128 {
int_impl! { i128, i128, u128, 128, -170141183460469231731687303715884105728,
170141183460469231731687303715884105727, "#![feature(i128)]
# fn main() {
", "
# }" }
170141183460469231731687303715884105727, "", "" }
}

#[cfg(target_pointer_width = "16")]
Expand Down Expand Up @@ -3492,11 +3489,7 @@ impl u64 {

#[lang = "u128"]
impl u128 {
uint_impl! { u128, u128, 128, 340282366920938463463374607431768211455, "#![feature(i128)]
# fn main() {
", "
# }" }
uint_impl! { u128, u128, 128, 340282366920938463463374607431768211455, "", "" }
}

#[cfg(target_pointer_width = "16")]
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/lib.rs
Expand Up @@ -52,8 +52,7 @@
#![feature(entry_or_default)]
#![feature(from_ref)]
#![feature(fs_read_write)]
#![feature(i128)]
#![cfg_attr(stage0, feature(i128_type))]
#![cfg_attr(stage0, feature(i128_type, i128))]
#![cfg_attr(stage0, feature(inclusive_range_syntax))]
#![cfg_attr(windows, feature(libc))]
#![feature(match_default_bindings)]
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_const_math/lib.rs
Expand Up @@ -19,8 +19,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![deny(warnings)]

#![feature(i128)]
#![cfg_attr(stage0, feature(i128_type))]
#![cfg_attr(stage0, feature(i128_type, i128))]

extern crate rustc_apfloat;

Expand Down
3 changes: 1 addition & 2 deletions src/librustc_data_structures/lib.rs
Expand Up @@ -26,9 +26,8 @@
#![feature(unboxed_closures)]
#![feature(fn_traits)]
#![feature(unsize)]
#![cfg_attr(stage0, feature(i128_type))]
#![feature(i128)]
#![cfg_attr(stage0, feature(conservative_impl_trait))]
#![cfg_attr(stage0, feature(i128_type, i128))]
#![feature(specialization)]
#![feature(optin_builtin_traits)]
#![feature(underscore_lifetimes)]
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_trans/lib.rs
Expand Up @@ -24,8 +24,7 @@
#![feature(custom_attribute)]
#![feature(fs_read_write)]
#![allow(unused_attributes)]
#![cfg_attr(stage0, feature(i128_type))]
#![feature(i128)]
#![cfg_attr(stage0, feature(i128_type, i128))]
#![cfg_attr(stage0, feature(inclusive_range_syntax))]
#![feature(libc)]
#![feature(quote)]
Expand Down
7 changes: 3 additions & 4 deletions src/libstd/lib.rs
Expand Up @@ -269,8 +269,7 @@
#![feature(generic_param_attrs)]
#![feature(hashmap_internals)]
#![feature(heap_api)]
#![feature(i128)]
#![cfg_attr(stage0, feature(i128_type))]
#![cfg_attr(stage0, feature(i128_type, i128))]
#![feature(int_error_internals)]
#![feature(integer_atomics)]
#![feature(into_cow)]
Expand Down Expand Up @@ -435,7 +434,7 @@ pub use core::i16;
pub use core::i32;
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::i64;
#[unstable(feature = "i128", issue = "35118")]
#[stable(feature = "i128", since = "1.26.0")]
pub use core::i128;
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::usize;
Expand Down Expand Up @@ -465,7 +464,7 @@ pub use alloc::string;
pub use alloc::vec;
#[stable(feature = "rust1", since = "1.0.0")]
pub use std_unicode::char;
#[unstable(feature = "i128", issue = "35118")]
#[stable(feature = "i128", since = "1.26.0")]
pub use core::u128;

pub mod f32;
Expand Down
12 changes: 8 additions & 4 deletions src/libsyntax/diagnostic_list.rs
Expand Up @@ -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 'i128'
enum Foo {
Bar(u64),
}
```
If you're using a stable or a beta version of rustc, you won't be able to use
Expand All @@ -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(repri128)]
fn main() {
let x = ::std::u128::MAX; // ok!
#[repr(u128)] // ok!
enum Foo {
Bar(u64),
}
```
"##,
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0658.stderr
Expand Up @@ -4,7 +4,7 @@ error[E0658]: use of unstable library feature 'i128' (see issue #35118)
LL | let _ = ::std::u128::MAX; //~ ERROR E0658
| ^^^^^^^^^^^^^^^^
|
= help: add #![feature(i128)] to the crate attributes to enable
= help: add #![feature(repri128)] to the crate attributes to enable

error: aborting due to previous error

Expand Down

0 comments on commit db7d9ea

Please sign in to comment.