Skip to content

Commit 80edfa8

Browse files
committed
clarify why this is UB
1 parent 964f2e1 commit 80edfa8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

reference/src/glossary.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ let raw2_wrong = raw1.wrapping_add(raw2.wrapping_sub(raw1 as usize) as usize);
7777
// raw2_wrong points to address 0x200 and has provenance @1.
7878
// In other words, raw2 and raw2_wrong have same *address*...
7979
assert_eq!(raw2 as usize, raw2_wrong as usize);
80-
// ...but it would be UB to use raw2_wrong, as it was obtained by
81-
// cross-allocation arithmetic. raw2_wrong has the wrong *provenance*:
80+
// ...but it would be UB to use raw2_wrong, as it has the wrong *provenance*:
8281
// it points to address 0x200 in allocation @2, but the pointer
8382
// has provenance @1.
8483
```

0 commit comments

Comments
 (0)