Skip to content

Commit

Permalink
Rollup merge of #94455 - jhpratt:stabilize-int_roundings, r=joshtriplett
Browse files Browse the repository at this point in the history
Partially stabilize `int_roundings`

This stabilizes the following:

```rust
impl uX {
    pub const fn div_ceil(self, rhs: Self) -> Self;
    pub const fn next_multiple_of(self, rhs: Self) -> Self;
    pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>;
}
```

This feature is tracked in #88581.
  • Loading branch information
matthiaskrgr authored Aug 12, 2023
2 parents b08dd92 + 62ca5aa commit 9aea966
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_codegen_ssa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![feature(associated_type_bounds)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(int_roundings)]
#![feature(let_chains)]
#![feature(negative_impls)]
#![feature(never_type)]
Expand Down
12 changes: 6 additions & 6 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,10 +2074,10 @@ macro_rules! uint_impl {
/// Basic usage:
///
/// ```
/// #![feature(int_roundings)]
#[doc = concat!("assert_eq!(7_", stringify!($SelfT), ".div_ceil(4), 2);")]
/// ```
#[unstable(feature = "int_roundings", issue = "88581")]
#[stable(feature = "int_roundings1", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "int_roundings1", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down Expand Up @@ -2109,11 +2109,11 @@ macro_rules! uint_impl {
/// Basic usage:
///
/// ```
/// #![feature(int_roundings)]
#[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".next_multiple_of(8), 16);")]
#[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".next_multiple_of(8), 24);")]
/// ```
#[unstable(feature = "int_roundings", issue = "88581")]
#[stable(feature = "int_roundings1", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "int_roundings1", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand All @@ -2134,13 +2134,13 @@ macro_rules! uint_impl {
/// Basic usage:
///
/// ```
/// #![feature(int_roundings)]
#[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".checked_next_multiple_of(8), Some(16));")]
#[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".checked_next_multiple_of(8), Some(24));")]
#[doc = concat!("assert_eq!(1_", stringify!($SelfT), ".checked_next_multiple_of(0), None);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.checked_next_multiple_of(2), None);")]
/// ```
#[unstable(feature = "int_roundings", issue = "88581")]
#[stable(feature = "int_roundings1", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "int_roundings1", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down
1 change: 0 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@
#![feature(float_next_up_down)]
#![feature(hasher_prefixfree_extras)]
#![feature(hashmap_internals)]
#![feature(int_roundings)]
#![feature(ip)]
#![feature(ip_in_core)]
#![feature(maybe_uninit_slice)]
Expand Down

0 comments on commit 9aea966

Please sign in to comment.