diff options
| -rw-r--r-- | doc/langref.html.in | 42 | ||||
| -rw-r--r-- | lib/docs/main.js | 5 | ||||
| -rw-r--r-- | src/Autodoc.zig | 17 | ||||
| -rw-r--r-- | test/behavior/error.zig | 15 |
4 files changed, 39 insertions, 40 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index a6a46979c4..36711e555a 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -9206,8 +9206,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@sin#} @@ -9217,8 +9216,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} @@ -9229,8 +9227,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} @@ -9241,8 +9238,7 @@ fn doTheTest() !void { Uses a dedicated hardware instruction when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} @@ -9253,8 +9249,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@exp2#} @@ -9264,8 +9259,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@log#} @@ -9275,8 +9269,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@log2#} @@ -9286,8 +9279,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@log10#} @@ -9297,8 +9289,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@fabs#} @@ -9308,8 +9299,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@floor#} @@ -9319,8 +9309,7 @@ fn doTheTest() !void { Uses a dedicated hardware instruction when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@ceil#} @@ -9330,8 +9319,7 @@ fn doTheTest() !void { Uses a dedicated hardware instruction when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@trunc#} @@ -9341,8 +9329,7 @@ fn doTheTest() !void { Uses a dedicated hardware instruction when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} {#header_open|@round#} @@ -9352,8 +9339,7 @@ fn doTheTest() !void { when available. </p> <p> - Supports {#link|Floats#} and {#link|Vectors#} of floats, with the caveat that - <a href="https://github.com/ziglang/zig/issues/4026">some float operations are not yet implemented for all float types</a>. + Supports {#link|Floats#} and {#link|Vectors#} of floats. </p> {#header_close#} diff --git a/lib/docs/main.js b/lib/docs/main.js index d488d018a6..fae39c5fba 100644 --- a/lib/docs/main.js +++ b/lib/docs/main.js @@ -1354,6 +1354,10 @@ const NAV_MODES = { payloadHtml += "ptrCast"; break; } + case "qual_cast": { + payloadHtml += "qualCast"; + break; + } case "truncate": { payloadHtml += "truncate"; break; @@ -3158,7 +3162,6 @@ const NAV_MODES = { canonTypeDecls = new Array(zigAnalysis.types.length); for (let pkgI = 0; pkgI < zigAnalysis.packages.length; pkgI += 1) { - if (pkgI === zigAnalysis.rootPkg && rootIsStd) continue; let pkg = zigAnalysis.packages[pkgI]; let pkgNames = canonPkgPaths[pkgI]; if (pkgNames === undefined) continue; diff --git a/src/Autodoc.zig b/src/Autodoc.zig index 8afc9c859b..0c2c39bbcc 100644 --- a/src/Autodoc.zig +++ b/src/Autodoc.zig @@ -1400,6 +1400,7 @@ fn walkInstruction( .float_cast, .int_cast, .ptr_cast, + .qual_cast, .truncate, .align_cast, .has_decl, @@ -2200,17 +2201,10 @@ fn walkInstruction( false, ); - _ = operand; - - // WIP - - printWithContext( - file, - inst_index, - "TODO: implement `{s}` for walkInstruction\n\n", - .{@tagName(tags[inst_index])}, - ); - return self.cteTodo(@tagName(tags[inst_index])); + return DocData.WalkResult{ + .typeRef = operand.expr, + .expr = .{ .@"struct" = &.{} }, + }; }, .struct_init_anon => { const pl_node = data[inst_index].pl_node; @@ -2537,6 +2531,7 @@ fn walkInstruction( const var_init_ref = @intToEnum(Ref, file.zir.extra[extra_index]); const var_init = try self.walkRef(file, parent_scope, parent_src, var_init_ref, need_type); value.expr = var_init.expr; + value.typeRef = var_init.typeRef; } return value; diff --git a/test/behavior/error.zig b/test/behavior/error.zig index b2a6cc5a50..f30290eb91 100644 --- a/test/behavior/error.zig +++ b/test/behavior/error.zig @@ -896,3 +896,18 @@ test "optional error union return type" { }; try expect(1234 == try S.foo().?); } + +test "optional error set return type" { + if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO + + const E = error{ A, B }; + const S = struct { + fn foo(return_null: bool) ?E { + return if (return_null) null else E.A; + } + }; + + try expect(null == S.foo(true)); + try expect(E.A == S.foo(false).?); +} |
