Skip to content

Commit a3d3de7

Browse files
committed
Fix doctests
1 parent 7d2d924 commit a3d3de7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

library/core/src/num/int_macros.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,10 @@ macro_rules! int_impl {
676676
/// Basic usage:
677677
///
678678
/// ```
679-
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 1).checked_div(-1), Some(", stringify!($Max), "));")]
680-
#[doc = concat!("assert_eq!((-5", stringify!($SelfT), ").checked_div(2), None);")]
681-
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_div(-1), None);")]
682-
#[doc = concat!("assert_eq!((1", stringify!($SelfT), ").checked_div(0), None);")]
679+
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 1).checked_norem_div(-1), Some(", stringify!($Max), "));")]
680+
#[doc = concat!("assert_eq!((-5", stringify!($SelfT), ").checked_norem_div(2), None);")]
681+
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_norem_div(-1), None);")]
682+
#[doc = concat!("assert_eq!((1", stringify!($SelfT), ").checked_norem_div(0), None);")]
683683
/// ```
684684
#[unstable(
685685
feature = "checked_norem_div",
@@ -702,6 +702,7 @@ macro_rules! int_impl {
702702
}
703703
}
704704
}
705+
705706
/// Checked integer remainder. Computes `self % rhs`, returning `None` if
706707
/// `rhs == 0` or the division results in overflow.
707708
///

library/core/src/num/uint_macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,9 @@ macro_rules! uint_impl {
662662
/// Basic usage:
663663
///
664664
/// ```
665-
#[doc = concat!("assert_eq!(128", stringify!($SelfT), ".checked_div(2), Some(64));")]
666-
#[doc = concat!("assert_eq!(129", stringify!($SelfT), ".checked_div(2), None);")]
667-
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_div(0), None);")]
665+
#[doc = concat!("assert_eq!(128", stringify!($SelfT), ".checked_norem_div(2), Some(64));")]
666+
#[doc = concat!("assert_eq!(129", stringify!($SelfT), ".checked_norem_div(2), None);")]
667+
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_norem_div(0), None);")]
668668
/// ```
669669
#[unstable(
670670
feature = "checked_norem_div",

0 commit comments

Comments
 (0)