diff --git a/doc/langref.html.in b/doc/langref.html.in
index e028cb8349..074c324de7 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -624,11 +624,6 @@
void |
Used for type-erased pointers. |
-
- | {#syntax#}void{#endsyntax#} |
- (none) |
- Always the value {#syntax#}void{}{#endsyntax#} |
-
| {#syntax#}noreturn{#endsyntax#} |
(none) |
@@ -1806,25 +1801,6 @@ const together = array1 ++ array2;
mem.eql(u32, &together, &[_]u32{1,2,3,4}){#endsyntax#}
-
- | Array Multiplication |
- {#syntax#}a ** b{#endsyntax#} |
-
-
- |
-
-
- - Only available when the length of {#syntax#}a{#endsyntax#} and {#syntax#}b{#endsyntax#} are {#link|compile-time known|comptime#}.
-
- |
-
- {#syntax#}const mem = @import("std").mem;
-const pattern = "ab" ** 3;
-mem.eql(u8, pattern, "ababab"){#endsyntax#}
- |
-
| Pointer Dereference |
{#syntax#}a.*{#endsyntax#} |
@@ -1882,7 +1858,7 @@ const B = error{Two};
a!b
x{}
!x -x -%x ~x &x ?x
-* / % ** *% *| ||
+* / % *% *| ||
+ - ++ +% -% +| -|
<< >> <<|
& ^ | orelse catch
@@ -2371,7 +2347,7 @@ or
Like arrays, tuples have a .len field, can be indexed (provided the index is comptime-known)
- and work with the ++ and ** operators. They can also be iterated over with {#link|inline for#}.
+ and work with the ++ operator. They can also be iterated over with {#link|inline for#}.
{#code|test_tuples.zig#}
@@ -2571,7 +2547,7 @@ or
{#header_close#}
{#header_open|Empty Blocks#}
- An empty block is equivalent to {#syntax#}void{}{#endsyntax#}:
+ An empty block returns the single value of type {#syntax#}void{#endsyntax#}:
{#code|test_empty_block.zig#}
{#header_close#}
@@ -3159,10 +3135,6 @@ fn createFoo(param: i32) !Foo {
the verbosity and cognitive overhead of trying to make sure every exit path
is covered. The deallocation code is always directly following the allocation code.
-
- The {#syntax#}errdefer{#endsyntax#} statement can optionally capture the error:
-
- {#code|test_errdefer_capture.zig#}
{#header_close#}
A couple of other tidbits about error handling:
@@ -3627,7 +3599,7 @@ void do_a_thing(struct Foo *foo) {
For some types, {#link|@sizeOf#} is 0:
- {#link|void#}
- - The {#link|Integers#} {#syntax#}u0{#endsyntax#} and {#syntax#}i0{#endsyntax#}.
+ - The {#link|integer type|Integers#} {#syntax#}u0{#endsyntax#}.
- {#link|Arrays#} and {#link|Vectors#} with len 0, or with an element type that is a zero bit type.
- An {#link|enum#} with only 1 tag.
- A {#link|struct#} with all fields being zero bit types.
@@ -8036,7 +8008,6 @@ MultiplyOp
/ ASTERISK
/ SLASH
/ PERCENT
- / ASTERISK2
/ ASTERISKPERCENT
/ ASTERISKPIPE
@@ -8083,11 +8054,11 @@ LabelableExpr
# Ptr specific
SliceTypeStart <- LBRACKET (COLON Expr)? RBRACKET
-SinglePtrTypeStart <- ASTERISK / ASTERISK2
+SinglePtrTypeStart <- ASTERISK
ManyPtrTypeStart <- LBRACKET ASTERISK (LETTERC / COLON Expr)? RBRACKET
-ArrayTypeStart <- LBRACKET Expr !(ASTERISK / ASTERISK2) (COLON Expr)? RBRACKET
+ArrayTypeStart <- LBRACKET Expr !ASTERISK (COLON Expr)? RBRACKET
# ContainerDecl specific
ContainerDeclAuto <- ContainerDeclType LBRACE ContainerMembers RBRACE
@@ -8215,7 +8186,6 @@ BUILTINIDENTIFIER <- '@'[A-Za-z_][A-Za-z0-9_]* skip
AMPERSAND <- '&' ![=] skip
AMPERSANDEQUAL <- '&=' skip
ASTERISK <- '*' ![*%=|] skip
-ASTERISK2 <- '**' skip
ASTERISKEQUAL <- '*=' skip
ASTERISKPERCENT <- '*%' ![=] skip
ASTERISKPERCENTEQUAL <- '*%=' skip
diff --git a/doc/langref/test_arrays.zig b/doc/langref/test_arrays.zig
index fa8d2ed3d3..a23bef8810 100644
--- a/doc/langref/test_arrays.zig
+++ b/doc/langref/test_arrays.zig
@@ -60,14 +60,8 @@ comptime {
assert(mem.eql(u8, hello_world, "hello world"));
}
-// ** does repeating patterns
-const pattern = "ab" ** 3;
-comptime {
- assert(mem.eql(u8, pattern, "ababab"));
-}
-
// initialize an array to zero
-const all_zero = [_]u16{0} ** 10;
+const all_zero: [10]u16 = @splat(0);
comptime {
assert(all_zero.len == 10);
@@ -96,7 +90,7 @@ test "compile-time array initialization" {
}
// call a function to initialize an array
-var more_points = [_]Point{makePoint(3)} ** 10;
+var more_points: [10]Point = @splat(makePoint(3));
fn makePoint(x: i32) Point {
return Point{
.x = x,
diff --git a/doc/langref/test_empty_block.zig b/doc/langref/test_empty_block.zig
index c12f9baefb..a7ce5c5c8a 100644
--- a/doc/langref/test_empty_block.zig
+++ b/doc/langref/test_empty_block.zig
@@ -3,10 +3,7 @@ const expectEqual = std.testing.expectEqual;
test {
const a = {};
- const b = void{};
try expectEqual(void, @TypeOf(a));
- try expectEqual(void, @TypeOf(b));
- try expectEqual(a, b);
}
// test
diff --git a/doc/langref/test_errdefer_capture.zig b/doc/langref/test_errdefer_capture.zig
deleted file mode 100644
index 26be5269bd..0000000000
--- a/doc/langref/test_errdefer_capture.zig
+++ /dev/null
@@ -1,19 +0,0 @@
-const std = @import("std");
-
-fn captureError(captured: *?anyerror) !void {
- errdefer |err| {
- captured.* = err;
- }
- return error.GeneralFailure;
-}
-
-test "errdefer capture" {
- var captured: ?anyerror = null;
-
- if (captureError(&captured)) unreachable else |err| {
- try std.testing.expectEqual(error.GeneralFailure, captured.?);
- try std.testing.expectEqual(error.GeneralFailure, err);
- }
-}
-
-// test
diff --git a/doc/langref/test_multidimensional_arrays.zig b/doc/langref/test_multidimensional_arrays.zig
index 6c7fefcaea..02e8b3d46c 100644
--- a/doc/langref/test_multidimensional_arrays.zig
+++ b/doc/langref/test_multidimensional_arrays.zig
@@ -24,7 +24,7 @@ test "multidimensional arrays" {
}
// Initialize a multidimensional array to zeros.
- const all_zero: [4][5]f32 = .{.{0} ** 5} ** 4;
+ const all_zero: [4][5]f32 = @splat(@splat(0));
try expectEqual(0, all_zero[0][0]);
}
diff --git a/doc/langref/test_tuples.zig b/doc/langref/test_tuples.zig
index 2d075b324f..41829530d4 100644
--- a/doc/langref/test_tuples.zig
+++ b/doc/langref/test_tuples.zig
@@ -8,7 +8,7 @@ test "tuple" {
@as(f64, 12.34),
true,
"hi",
- } ++ .{false} ** 2;
+ } ++ .{ false, false };
try expectEqual(1234, values[0]);
try expectEqual(false, values[4]);
inline for (values, 0..) |v, i| {