diff --git a/doc/langref.html.in b/doc/langref.html.in index 97263347c7..bebbdaaa13 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -566,7 +566,7 @@ const c_string_literal = {#header_close#} {#header_close#} {#header_open|Assignment#} -

Use const to assign a value to an identifier:

+

Use the const keyword to assign a value to an identifier:

{#code_begin|test_err|cannot assign to constant#} const x = 1234; @@ -582,7 +582,8 @@ test "assignment" { foo(); } {#code_end#} -

If you need a variable that you can modify, use var:

+

const applies to all of the bytes that the identifier immediately addresses. {#link|Pointers#} have their own const-ness.

+

If you need a variable that you can modify, use the var keyword:

{#code_begin|test#} const assert = @import("std").debug.assert; @@ -1918,7 +1919,7 @@ test "linked list" { assert(list2.first.?.data == 1234); } {#code_end#} - {#header_open|struct naming#} + {#header_open|struct Naming#}

Since all structs are anonymous, Zig infers the type name based on a few rules.