Skip to content

Commit 822bb9a

Browse files
authored
Rollup merge of #73208 - qm3ster:patch-1, r=Amanieu
Fix doctest template `saturating_add` example was not parameterized, but passed because the `u8` would saturate successfully
2 parents d9cf7a1 + 7dc19b0 commit 822bb9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libcore/num/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3309,7 +3309,8 @@ Basic usage:
33093309
33103310
```
33113311
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101);
3312-
assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, "
3312+
assert_eq!(", stringify!($SelfT), "::MAX.saturating_add(127), ", stringify!($SelfT), "::MAX);",
3313+
$EndFeature, "
33133314
```"),
33143315

33153316
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)