From d484269543c571454818599cce0460f9b363631f Mon Sep 17 00:00:00 2001 From: kj4tmp <56497124+kj4tmp@users.noreply.github.com> Date: Sun, 21 Jul 2024 02:41:43 -0700 Subject: [PATCH] improve `@enumFromInt` doc (#20354) closes #19123 --- doc/langref.html.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 626defe397..9d38e9b856 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -4710,8 +4710,11 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val Converts an integer into an {#link|enum#} value. The return type is the inferred result type.

- Attempting to convert an integer which represents no value in the chosen enum type invokes + Attempting to convert an integer with no corresponding value in the enum invokes safety-checked {#link|Undefined Behavior#}. + Note that a {#link|non-exhaustive enum|Non-exhaustive enum#} has corresponding values for all + integers in the enum's integer tag type: the {#syntax#}_{#endsyntax#} value represents all + the remaining unnamed integers in the enum's tag type.

{#see_also|@intFromEnum#} {#header_close#}