authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-03-24 00:00:52+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-07 14:54:53-04:00
logb7f116a774ce64b39ddf9798e135aee76d03f44e
tree1e2873007da2ab4f7f393dbf427a753f5dd1fb97
parent22dbeab29dab9e349122a539acdf7e32561109dd

langref: small updates


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

doc/langref.html.in+4-6
......@@ -247,8 +247,7 @@ pub fn main() void {
247247}
248248 {#code_end#}
249249 <p>
250 Note that we also left off the {#syntax#}!{#endsyntax#} from the return type.
251 In Zig, if your main function cannot fail, you must use the {#syntax#}void{#endsyntax#} return type.
250 Note that you can leave off the {#syntax#}!{#endsyntax#} from the return type because {#syntax#}warn{#endsyntax#} cannot fail.
252251 </p>
253252 {#see_also|Values|@import|Errors|Root Source File#}
254253 {#header_close#}
......@@ -985,7 +984,7 @@ export fn foo_strict(x: f64) f64 {
985984}
986985
987986export fn foo_optimized(x: f64) f64 {
988 @setFloatMode(builtin.FloatMode.Optimized);
987 @setFloatMode(.Optimized);
989988 return x + big - big;
990989}
991990 {#code_end#}
......@@ -2992,7 +2991,7 @@ test "simple union" {
29922991 This turns the union into a <em>tagged</em> union, which makes it eligible
29932992 to use with {#link|switch#} expressions. One can use {#link|@TagType#} to
29942993 obtain the enum type from the union type.
2995 Tagged unions coerce to their enum {#link|Type Coercion: unions and enums#}
2994 Tagged unions coerce to their tag type: {#link|Type Coercion: unions and enums#}.
29962995 </p>
29972996 {#code_begin|test#}
29982997const std = @import("std");
......@@ -9479,7 +9478,7 @@ pub fn main() void {
94799478const builtin = @import("builtin");
94809479
94819480const c = @cImport({
9482 @cDefine("NDEBUG", builtin.mode == builtin.Mode.ReleaseFast);
9481 @cDefine("NDEBUG", builtin.mode == .ReleaseFast);
94839482 if (something) {
94849483 @cDefine("_GNU_SOURCE", {});
94859484 }
......@@ -10077,7 +10076,6 @@ fn readU32Be() u32 {}
1007710076 {#header_open|Keyword: pub#}
1007810077 <p>The {#syntax#}pub{#endsyntax#} in front of a top level declaration makes the
1007910078 declaration available to reference from a different file than the one it is declared in.</p>
10080 <p><a href="https://github.com/ziglang/zig/issues/2059">TODO delete pub syntax for fields, or make it do something.</a></p>
1008110079 {#see_also|@import#}
1008210080 {#header_close#}
1008310081 {#header_close#}