You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/deliberate-ub.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,9 @@ We should evaluate whether there truly is some use-case here that is not current
16
16
The LLVM IR we generate here contains `noundef` so this UB is not just a specification artifact.<br>
17
17
Furthermore, `compare_exchange` will compare padding bytes, which leads to UB.
18
18
It is not clear how to best specify a useful `compare_exchange` that can work on padding bytes,
19
-
see the [discussion here](https://github.com/rust-lang/unsafe-code-guidelines/issues/449).
19
+
see the [discussion here](https://github.com/rust-lang/unsafe-code-guidelines/issues/449).<br>
20
+
The alternative is to not use the "fast path" for problematic types (and fall back to the SeqLock), but that requires some way to query at `const`-time whether the type contains padding (or provenance).
21
+
(Or of course one can use inline assembly, but it would be better if that was not required.)
0 commit comments