Skip to content

Commit 1779ffa

Browse files
committed
Make members of {std,core}::{i128,u128} unstable
Adding it in a stable form was an accident. It thankfully only leaked to nightly. Fixes #38860
1 parent 28f6d4a commit 1779ffa

File tree

6 files changed

+44
-24
lines changed

6 files changed

+44
-24
lines changed

src/libcore/num/i128.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
1515
#![unstable(feature = "i128", issue="35118")]
1616

17-
int_module! { i128 }
17+
int_module! { i128, #[unstable(feature = "i128", issue="35118")] }

src/libcore/num/int_macros.rs

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2017 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -10,13 +10,14 @@
1010

1111
#![doc(hidden)]
1212

13-
macro_rules! int_module { ($T:ident) => (
14-
15-
/// The smallest value that can be represented by this integer type.
16-
#[stable(feature = "rust1", since = "1.0.0")]
17-
pub const MIN: $T = $T::min_value();
18-
/// The largest value that can be represented by this integer type.
19-
#[stable(feature = "rust1", since = "1.0.0")]
20-
pub const MAX: $T = $T::max_value();
21-
22-
) }
13+
macro_rules! int_module {
14+
($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
15+
($T:ident, $($attr: tt)*) => (
16+
/// The smallest value that can be represented by this integer type.
17+
$($attr)*
18+
pub const MIN: $T = $T::min_value();
19+
/// The largest value that can be represented by this integer type.
20+
$($attr)*
21+
pub const MAX: $T = $T::max_value();
22+
)
23+
}

src/libcore/num/u128.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
//! *[See also the `u128` primitive type](../../std/primitive.u128.html).*
1414
1515
#![unstable(feature = "i128", issue="35118")]
16-
uint_module! { u128 }
16+
uint_module! { u128, #[unstable(feature = "i128", issue="35118")] }

src/libcore/num/uint_macros.rs

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2017 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -10,13 +10,14 @@
1010

1111
#![doc(hidden)]
1212

13-
macro_rules! uint_module { ($T:ident) => (
14-
15-
/// The smallest value that can be represented by this integer type.
16-
#[stable(feature = "rust1", since = "1.0.0")]
17-
pub const MIN: $T = $T::min_value();
18-
/// The largest value that can be represented by this integer type.
19-
#[stable(feature = "rust1", since = "1.0.0")]
20-
pub const MAX: $T = $T::max_value();
21-
22-
) }
13+
macro_rules! uint_module {
14+
($T:ident) => (uint_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
15+
($T:ident, $($attr: tt)*) => (
16+
/// The smallest value that can be represented by this integer type.
17+
$($attr)*
18+
pub const MIN: $T = $T::min_value();
19+
/// The largest value that can be represented by this integer type.
20+
$($attr)*
21+
pub const MAX: $T = $T::max_value();
22+
)
23+
}

src/librustc_const_math/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#![feature(rustc_private)]
2727
#![feature(staged_api)]
2828
#![feature(const_fn)]
29+
#![cfg_attr(not(stage0), feature(i128))]
2930

3031
#[macro_use] extern crate log;
3132
#[macro_use] extern crate syntax;
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn testl() {
12+
::std::u128::MAX; //~ ERROR use of unstable library feature 'i128'
13+
}
14+
15+
fn testl2() {
16+
::std::i128::MAX; //~ ERROR use of unstable library feature 'i128'
17+
}

0 commit comments

Comments
 (0)