Make saturating_div
Docs Consistent with Others
This commit is contained in:
parent
724fe8fcfb
commit
6b8eae0d24
@ -1121,6 +1121,10 @@ macro_rules! int_impl {
|
|||||||
/// Saturating integer division. Computes `self / rhs`, saturating at the
|
/// Saturating integer division. Computes `self / rhs`, saturating at the
|
||||||
/// numeric bounds instead of overflowing.
|
/// numeric bounds instead of overflowing.
|
||||||
///
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// This function will panic if `rhs` is 0.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// Basic usage:
|
/// Basic usage:
|
||||||
@ -1131,11 +1135,6 @@ macro_rules! int_impl {
|
|||||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_div(-1), ", stringify!($SelfT), "::MAX);")]
|
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_div(-1), ", stringify!($SelfT), "::MAX);")]
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
///
|
|
||||||
/// ```should_panic
|
|
||||||
#[doc = concat!("let _ = 1", stringify!($SelfT), ".saturating_div(0);")]
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
#[stable(feature = "saturating_div", since = "1.58.0")]
|
#[stable(feature = "saturating_div", since = "1.58.0")]
|
||||||
#[rustc_const_stable(feature = "saturating_div", since = "1.58.0")]
|
#[rustc_const_stable(feature = "saturating_div", since = "1.58.0")]
|
||||||
#[must_use = "this returns the result of the operation, \
|
#[must_use = "this returns the result of the operation, \
|
||||||
|
@ -1123,6 +1123,10 @@ macro_rules! uint_impl {
|
|||||||
/// Saturating integer division. Computes `self / rhs`, saturating at the
|
/// Saturating integer division. Computes `self / rhs`, saturating at the
|
||||||
/// numeric bounds instead of overflowing.
|
/// numeric bounds instead of overflowing.
|
||||||
///
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// This function will panic if `rhs` is 0.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// Basic usage:
|
/// Basic usage:
|
||||||
@ -1131,11 +1135,6 @@ macro_rules! uint_impl {
|
|||||||
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".saturating_div(2), 2);")]
|
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".saturating_div(2), 2);")]
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
///
|
|
||||||
/// ```should_panic
|
|
||||||
#[doc = concat!("let _ = 1", stringify!($SelfT), ".saturating_div(0);")]
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
#[stable(feature = "saturating_div", since = "1.58.0")]
|
#[stable(feature = "saturating_div", since = "1.58.0")]
|
||||||
#[rustc_const_stable(feature = "saturating_div", since = "1.58.0")]
|
#[rustc_const_stable(feature = "saturating_div", since = "1.58.0")]
|
||||||
#[must_use = "this returns the result of the operation, \
|
#[must_use = "this returns the result of the operation, \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user