Skip to content

Commit 8dff78c

Browse files
committed
Fix method receiver lint in core doctests
1 parent 147c90f commit 8dff78c

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

library/core/src/num/f128.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ impl f128 {
13231323
/// assert!((-3.0f128).clamp(-2.0, 1.0) == -2.0);
13241324
/// assert!((0.0f128).clamp(-2.0, 1.0) == 0.0);
13251325
/// assert!((2.0f128).clamp(-2.0, 1.0) == 1.0);
1326-
/// assert!((f128::NAN).clamp(-2.0, 1.0).is_nan());
1326+
/// assert!(f128::NAN.clamp(-2.0, 1.0).is_nan());
13271327
///
13281328
/// // These always returns zero, but the sign (which is ignored by `==`) is non-deterministic.
13291329
/// assert!((0.0f128).clamp(-0.0, -0.0) == 0.0);

library/core/src/num/f16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ impl f16 {
13071307
/// assert!((-3.0f16).clamp(-2.0, 1.0) == -2.0);
13081308
/// assert!((0.0f16).clamp(-2.0, 1.0) == 0.0);
13091309
/// assert!((2.0f16).clamp(-2.0, 1.0) == 1.0);
1310-
/// assert!((f16::NAN).clamp(-2.0, 1.0).is_nan());
1310+
/// assert!(f16::NAN.clamp(-2.0, 1.0).is_nan());
13111311
///
13121312
/// // These always returns zero, but the sign (which is ignored by `==`) is non-deterministic.
13131313
/// assert!((0.0f16).clamp(-0.0, -0.0) == 0.0);

library/core/src/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ impl f32 {
14891489
/// assert!((-3.0f32).clamp(-2.0, 1.0) == -2.0);
14901490
/// assert!((0.0f32).clamp(-2.0, 1.0) == 0.0);
14911491
/// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
1492-
/// assert!((f32::NAN).clamp(-2.0, 1.0).is_nan());
1492+
/// assert!(f32::NAN.clamp(-2.0, 1.0).is_nan());
14931493
///
14941494
/// // These always returns zero, but the sign (which is ignored by `==`) is non-deterministic.
14951495
/// assert!((0.0f32).clamp(-0.0, -0.0) == 0.0);

library/core/src/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ impl f64 {
14871487
/// assert!((-3.0f64).clamp(-2.0, 1.0) == -2.0);
14881488
/// assert!((0.0f64).clamp(-2.0, 1.0) == 0.0);
14891489
/// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
1490-
/// assert!((f64::NAN).clamp(-2.0, 1.0).is_nan());
1490+
/// assert!(f64::NAN.clamp(-2.0, 1.0).is_nan());
14911491
///
14921492
/// // These always returns zero, but the sign (which is ignored by `==`) is non-deterministic.
14931493
/// assert!((0.0f64).clamp(-0.0, -0.0) == 0.0);

library/core/src/num/int_macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,7 +2570,7 @@ macro_rules! int_impl {
25702570
///
25712571
/// ```
25722572
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".overflowing_add_unsigned(2), (3, false));")]
2573-
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN).overflowing_add_unsigned(", stringify!($UnsignedT), "::MAX), (", stringify!($SelfT), "::MAX, false));")]
2573+
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_add_unsigned(", stringify!($UnsignedT), "::MAX), (", stringify!($SelfT), "::MAX, false));")]
25742574
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MAX - 2).overflowing_add_unsigned(3), (", stringify!($SelfT), "::MIN, true));")]
25752575
/// ```
25762576
#[stable(feature = "mixed_integer_ops", since = "1.66.0")]
@@ -2677,7 +2677,7 @@ macro_rules! int_impl {
26772677
///
26782678
/// ```
26792679
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".overflowing_sub_unsigned(2), (-1, false));")]
2680-
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MAX).overflowing_sub_unsigned(", stringify!($UnsignedT), "::MAX), (", stringify!($SelfT), "::MIN, false));")]
2680+
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.overflowing_sub_unsigned(", stringify!($UnsignedT), "::MAX), (", stringify!($SelfT), "::MIN, false));")]
26812681
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 2).overflowing_sub_unsigned(3), (", stringify!($SelfT), "::MAX, true));")]
26822682
/// ```
26832683
#[stable(feature = "mixed_integer_ops", since = "1.66.0")]
@@ -3010,7 +3010,7 @@ macro_rules! int_impl {
30103010
/// ```
30113011
#[doc = concat!("assert_eq!(10", stringify!($SelfT), ".overflowing_abs(), (10, false));")]
30123012
#[doc = concat!("assert_eq!((-10", stringify!($SelfT), ").overflowing_abs(), (10, false));")]
3013-
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN).overflowing_abs(), (", stringify!($SelfT), "::MIN, true));")]
3013+
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_abs(), (", stringify!($SelfT), "::MIN, true));")]
30143014
/// ```
30153015
#[stable(feature = "no_panic_abs", since = "1.13.0")]
30163016
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]

0 commit comments

Comments
 (0)