Skip to content

Commit 4d747ee

Browse files
committed
fix CheckedAdd example
1 parent 508ae47 commit 4d747ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

text/0000-infallible-promotion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Note that arithmetic overflow is not a problem: an addition in debug mode is com
107107
We only ever promote the `CheckedAdd`, so evaluation of the promoted will never fail, even if the operation overflows.
108108
For example, `&(1 + u32::MAX)` turns into something like:
109109
```rust
110-
const C: (u32, bool) = CheckedAdd(1, u32::MAX); // evaluates to (1, true).
110+
const C: (u32, bool) = CheckedAdd(1, u32::MAX); // evaluates to (0, true).
111111
assert!(C.1 == false);
112112
&C.0
113113
```

0 commit comments

Comments
 (0)