Skip to content

Commit b026ace

Browse files
committed
Add note about producing ! at runtime being UB
1 parent 2f75e78 commit b026ace

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/types/never.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ r[type.never.intro]
1010
The never type `!` is a type with no values, representing the result of
1111
computations that never complete.
1212

13+
> [!NOTE]
14+
> Because `!` has no values, reading it from memory (or otherwise producing a value of the type at runtime) is immediate undefined behaviour.
15+
1316
r[type.never.coercion]
1417
Expressions of type `!` can be coerced into any other type.
1518

0 commit comments

Comments
 (0)