From 4942e4e8701b9a137d7f30fcb8ac1bc2d46f2a99 Mon Sep 17 00:00:00 2001 From: Hashi364 <49736221+Kiyoshi364@users.noreply.github.com> Date: Mon, 13 Mar 2023 11:47:20 -0300 Subject: [PATCH] Resolve docs inconsistency with Overflow builtins In 41 (Undefined Behavior) . 5 (Integer Overflow) . 3 (Builtin Overflow Functions), it is stated that > These builtins return a bool of whether or not overflow occurred, as well as returning the overflowed bits: > * @addWithOverflow > * @subWithOverflow > * @mulWithOverflow > * @shlWithOverflow but in their definition says that it returns a `tuple`/`struct`. Example; `@addWithOverflow(a: anytype, b: anytype) struct { @TypeOf(a, b), u1 }` Co-authored-by: zooster --- doc/langref.html.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 9cee35caa2..991fd0c3e6 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -9804,8 +9804,8 @@ pub fn main() !void { {#header_close#} {#header_open|Builtin Overflow Functions#}

- These builtins return a {#syntax#}bool{#endsyntax#} of whether or not overflow - occurred, as well as returning the overflowed bits: + These builtins return a tuple containing whether there was an overflow + (as a {#syntax#}u1{#endsyntax#}) and the possibly overflowed bits of the operation: