authorgravatar for kj4tmp@gmail.comkj4tmp <kj4tmp@gmail.com> 2024-07-21 02:41:43-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-21 02:41:43-07:00
logd484269543c571454818599cce0460f9b363631f
treeec218c095e86d6a39e0ad9eb5ddac9b2c40ebec8
parent1dbee05609fc60e62756c488e8ad82a3e4abd596
signaturebadge-check Signed by PGP key B5690EEEBB952194

improve `@enumFromInt` doc (#20354)

closes #19123

1 files changed, 4 insertions(+), 1 deletions(-)

doc/langref.html.in+4-1
......@@ -4710,8 +4710,11 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
47104710 Converts an integer into an {#link|enum#} value. The return type is the inferred result type.
47114711 </p>
47124712 <p>
4713 Attempting to convert an integer which represents no value in the chosen enum type invokes
4713 Attempting to convert an integer with no corresponding value in the enum invokes
47144714 safety-checked {#link|Undefined Behavior#}.
4715 Note that a {#link|non-exhaustive enum|Non-exhaustive enum#} has corresponding values for all
4716 integers in the enum's integer tag type: the {#syntax#}_{#endsyntax#} value represents all
4717 the remaining unnamed integers in the enum's tag type.
47154718 </p>
47164719 {#see_also|@intFromEnum#}
47174720 {#header_close#}