authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-11-19 13:20:39-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-11-19 13:20:39-05:00
logb1a676b279db81e83f694142590fca9b53a6a235
treeec5f40f52a6cb24e1cb58bfb6ebbd4c8f246126c
parent2f5d1ec5006ccae81f6de80233fa7800237779e2
signaturelock-open Commit is signed but in an unrecognized format.

docs: fix some incorrect error documentation


1 files changed, 11 insertions(+), 14 deletions(-)

doc/langref.html.in+11-14
......@@ -3273,13 +3273,13 @@ const err = (error {FileNotFound}).FileNotFound;
32733273 This becomes useful when using {#link|Inferred Error Sets#}.
32743274 </p>
32753275 {#header_open|The Global Error Set#}
3276 <p>{#syntax#}error{#endsyntax#} refers to the global error set.
3276 <p>{#syntax#}anyerror{#endsyntax#} refers to the global error set.
32773277 This is the error set that contains all errors in the entire compilation unit.
32783278 It is a superset of all other error sets and a subset of none of them.
32793279 </p>
32803280 <p>
32813281 You can implicitly cast any error set to the global one, and you can explicitly
3282 cast an error of global error set to a non-global one. This inserts a language-level
3282 cast an error of the global error set to a non-global one. This inserts a language-level
32833283 assert to make sure the error value is in fact in the destination error set.
32843284 </p>
32853285 <p>
......@@ -5601,18 +5601,14 @@ test "main" {
56015601 {#header_close#}
56025602
56035603 {#header_open|@errorName#}
5604 <pre>{#syntax#}@errorName(err: error) []u8{#endsyntax#}</pre>
5604 <pre>{#syntax#}@errorName(err: anyerror) []const u8{#endsyntax#}</pre>
56055605 <p>
5606 This function returns the string representation of an error. If an error
5607 declaration is:
5608 </p>
5609 <pre>{#syntax#}error OutOfMem{#endsyntax#}</pre>
5610 <p>
5611 Then the string representation is {#syntax#}"OutOfMem"{#endsyntax#}.
5606 This function returns the string representation of an error. The string representation
5607 of {#syntax#}error.OutOfMem{#endsyntax#} is {#syntax#}"OutOfMem"{#endsyntax#}.
56125608 </p>
56135609 <p>
56145610 If there are no calls to {#syntax#}@errorName{#endsyntax#} in an entire application,
5615 or all calls have a compile-time known value for {#syntax#}err{#endsyntax#}, then no
5611 or all calls have a compile-time known value for {#syntax#}err{#endsyntax#}, then no
56165612 error name table will be generated.
56175613 </p>
56185614 {#header_close#}
......@@ -5627,13 +5623,14 @@ test "main" {
56275623 {#header_close#}
56285624
56295625 {#header_open|@errorToInt#}
5630 <pre>{#syntax#}@errorToInt(err: var) @IntType(false, @sizeOf(error) * 8){#endsyntax#}</pre>
5626 <pre>{#syntax#}@errorToInt(err: var) @IntType(false, @sizeOf(anyerror) * 8){#endsyntax#}</pre>
56315627 <p>
56325628 Supports the following types:
56335629 </p>
56345630 <ul>
5635 <li>error unions</li>
5636 <li>{#syntax#}E!void{#endsyntax#}</li>
5631 <li>{#link|The Global Error Set#}</li>
5632 <li>{#link|Error Set Type#}</li>
5633 <li>{#link|Error Union Type#}</li>
56375634 </ul>
56385635 <p>
56395636 Converts an error to the integer representation of an error.
......@@ -5788,7 +5785,7 @@ fn add(a: i32, b: i32) i32 { return a + b; }
57885785 {#header_open|@intToError#}
57895786 <pre>{#syntax#}@intToError(value: @IntType(false, @sizeOf(anyerror) * 8)) anyerror{#endsyntax#}</pre>
57905787 <p>
5791 Converts from the integer representation of an error into the global error set type.
5788 Converts from the integer representation of an error into {#link|The Global Error Set#} type.
57925789 </p>
57935790 <p>
57945791 It is generally recommended to avoid this