Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/src/iter/traits/accum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ macro_rules! float_sum_product {

integer_sum_product! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
saturating_integer_sum_product! { u8 u16 u32 u64 u128 usize }
float_sum_product! { f32 f64 }
float_sum_product! { f16 f32 f64 f128 }

#[stable(feature = "iter_arith_traits_result", since = "1.16.0")]
impl<T, U, E> Sum<Result<U, E>> for Result<T, E>
Expand Down
51 changes: 10 additions & 41 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,47 +252,16 @@ pub use crate::macros::cfg_select;
#[macro_use]
mod internal_macros;

#[path = "num/shells/int_macros.rs"]
#[macro_use]
mod int_macros;

#[rustc_diagnostic_item = "i128_legacy_mod"]
#[path = "num/shells/i128.rs"]
pub mod i128;
#[rustc_diagnostic_item = "i16_legacy_mod"]
#[path = "num/shells/i16.rs"]
pub mod i16;
#[rustc_diagnostic_item = "i32_legacy_mod"]
#[path = "num/shells/i32.rs"]
pub mod i32;
#[rustc_diagnostic_item = "i64_legacy_mod"]
#[path = "num/shells/i64.rs"]
pub mod i64;
#[rustc_diagnostic_item = "i8_legacy_mod"]
#[path = "num/shells/i8.rs"]
pub mod i8;
#[rustc_diagnostic_item = "isize_legacy_mod"]
#[path = "num/shells/isize.rs"]
pub mod isize;

#[rustc_diagnostic_item = "u128_legacy_mod"]
#[path = "num/shells/u128.rs"]
pub mod u128;
#[rustc_diagnostic_item = "u16_legacy_mod"]
#[path = "num/shells/u16.rs"]
pub mod u16;
#[rustc_diagnostic_item = "u32_legacy_mod"]
#[path = "num/shells/u32.rs"]
pub mod u32;
#[rustc_diagnostic_item = "u64_legacy_mod"]
#[path = "num/shells/u64.rs"]
pub mod u64;
#[rustc_diagnostic_item = "u8_legacy_mod"]
#[path = "num/shells/u8.rs"]
pub mod u8;
#[rustc_diagnostic_item = "usize_legacy_mod"]
#[path = "num/shells/usize.rs"]
pub mod usize;
#[path = "num/shells/legacy_int_modules.rs"]
mod legacy_int_modules;
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
#[allow(deprecated_in_future)]
pub use legacy_int_modules::{i8, i16, i32, i64, isize, u8, u16, u32, u64, usize};
#[stable(feature = "i128", since = "1.26.0")]
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
#[allow(deprecated_in_future)]
pub use legacy_int_modules::{i128, u128};

#[path = "num/f128.rs"]
pub mod f128;
Expand Down
1 change: 1 addition & 0 deletions core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ pub(crate) mod builtin {
)]
#[allow_internal_unstable(fmt_internals)]
#[rustc_builtin_macro]
#[doc(hidden)]
#[macro_export]
macro_rules! format_args_nl {
($fmt:expr) => {{ /* compiler built-in */ }};
Expand Down
11 changes: 0 additions & 11 deletions core/src/num/shells/i128.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/i16.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/i32.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/i64.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/i8.rs

This file was deleted.

46 changes: 0 additions & 46 deletions core/src/num/shells/int_macros.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/isize.rs

This file was deleted.

71 changes: 71 additions & 0 deletions core/src/num/shells/legacy_int_modules.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#![doc(hidden)]

macro_rules! legacy_int_module {
($T:ident) => (legacy_int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
($T:ident, #[$attr:meta]) => (
#[$attr]
#[deprecated(
since = "TBD",
note = "all constants in this module replaced by associated constants on the type"
)]
#[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_mod")]
pub mod $T {
#![doc = concat!("Redundant constants module for the [`", stringify!($T), "` primitive type][", stringify!($T), "].")]
//!
//! New code should use the associated constants directly on the primitive type.

#[doc = concat!(
"The smallest value that can be represented by this integer type. Use ",
"[`", stringify!($T), "::MIN", "`] instead."
)]
///
/// # Examples
///
/// ```rust
/// // deprecated way
#[doc = concat!("let min = std::", stringify!($T), "::MIN;")]
///
/// // intended way
#[doc = concat!("let min = ", stringify!($T), "::MIN;")]
/// ```
///
#[$attr]
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
#[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_const_min")]
pub const MIN: $T = $T::MIN;

#[doc = concat!(
"The largest value that can be represented by this integer type. Use ",
"[`", stringify!($T), "::MAX", "`] instead."
)]
///
/// # Examples
///
/// ```rust
/// // deprecated way
#[doc = concat!("let max = std::", stringify!($T), "::MAX;")]
///
/// // intended way
#[doc = concat!("let max = ", stringify!($T), "::MAX;")]
/// ```
///
#[$attr]
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
#[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_const_max")]
pub const MAX: $T = $T::MAX;
}
)
}

legacy_int_module! { i128, #[stable(feature = "i128", since = "1.26.0")] }
legacy_int_module! { i16 }
legacy_int_module! { i32 }
legacy_int_module! { i64 }
legacy_int_module! { i8 }
legacy_int_module! { isize }
legacy_int_module! { u128, #[stable(feature = "i128", since = "1.26.0")] }
legacy_int_module! { u16 }
legacy_int_module! { u32 }
legacy_int_module! { u64 }
legacy_int_module! { u8 }
legacy_int_module! { usize }
11 changes: 0 additions & 11 deletions core/src/num/shells/u128.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/u16.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/u32.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/u64.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/u8.rs

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/num/shells/usize.rs

This file was deleted.

Loading
Loading