diff options
| -rw-r--r-- | doc/langref.html.in | 15 | ||||
| -rw-r--r-- | lib/std/builtin.zig | 14 | ||||
| -rw-r--r-- | src/all_types.hpp | 10 | ||||
| -rw-r--r-- | test/compile_errors.zig | 4 |
4 files changed, 16 insertions, 27 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index ba0aa7a778..e7b28014bd 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -6870,16 +6870,6 @@ pub const CallOptions = struct { /// Equivalent to function call syntax. auto, - /// Asserts that the function call will not suspend. This allows a - /// non-async function to call an async function. - no_async, - - /// The function call will return an async function frame instead of - /// the function's result, which is expected to then be awaited. - /// This is equivalent to using the `async` keyword in front of function - /// call syntax. - async_call, - /// Prevents tail call optimization. This guarantees that the return /// address will point to the callsite, as opposed to the callsite's /// callsite. If the call is otherwise required to be tail-called @@ -6890,6 +6880,10 @@ pub const CallOptions = struct { /// otherwise required to be inlined, a compile error is emitted instead. never_inline, + /// Asserts that the function call will not suspend. This allows a + /// non-async function to call an async function. + no_async, + /// Guarantees that the call will be generated with tail call optimization. /// If this is not possible, a compile error is emitted instead. always_tail, @@ -6938,7 +6932,6 @@ fn targetFunction(x: i32) usize { } {#code_end#} {#header_close#} - {#header_close#} {#header_open|@cDefine#} diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 8ac58ad2f4..35188b61e3 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -382,16 +382,6 @@ pub const CallOptions = struct { /// Equivalent to function call syntax. auto, - /// Asserts that the function call will not suspend. This allows a - /// non-async function to call an async function. - no_async, - - /// The function call will return an async function frame instead of - /// the function's result, which is expected to then be awaited. - /// This is equivalent to using the `async` keyword in front of function - /// call syntax. - async_call, - /// Prevents tail call optimization. This guarantees that the return /// address will point to the callsite, as opposed to the callsite's /// callsite. If the call is otherwise required to be tail-called @@ -402,6 +392,10 @@ pub const CallOptions = struct { /// otherwise required to be inlined, a compile error is emitted instead. never_inline, + /// Asserts that the function call will not suspend. This allows a + /// non-async function to call an async function. + no_async, + /// Guarantees that the call will be generated with tail call optimization. /// If this is not possible, a compile error is emitted instead. always_tail, diff --git a/src/all_types.hpp b/src/all_types.hpp index c8804ac273..a5b0804985 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -409,6 +409,9 @@ struct ZigValue { LLVMValueRef llvm_global; union { + // populated if special == ConstValSpecialLazy + LazyValue *x_lazy; + // populated if special == ConstValSpecialStatic BigInt x_bigint; BigFloat x_bigfloat; @@ -429,7 +432,6 @@ struct ZigValue { ConstPtrValue x_ptr; ConstArgTuple x_arg_tuple; Buf *x_enum_literal; - LazyValue *x_lazy; // populated if special == ConstValSpecialRuntime RuntimeHintErrorUnion rh_error_union; @@ -770,16 +772,16 @@ struct AstNodeUnwrapOptional { // Must be synchronized with std.builtin.CallOptions.Modifier enum CallModifier { CallModifierNone, - CallModifierNoAsync, - CallModifierAsync, CallModifierNeverTail, CallModifierNeverInline, + CallModifierNoAsync, CallModifierAlwaysTail, CallModifierAlwaysInline, CallModifierCompileTime, - // This is an additional tag in the compiler, but not exposed in the std lib. + // These are additional tags in the compiler, but not exposed in the std lib. CallModifierBuiltin, + CallModifierAsync, }; struct AstNodeFnCallExpr { diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 9494879f71..13e666f49e 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -45,9 +45,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { cases.addCase(x: { var tc = cases.create("call with new stack on unsupported target", + \\var buf: [10]u8 align(16) = undefined; \\export fn entry() void { - \\ var buf: [10]u8 align(16) = undefined; - \\ @call(.{.stack = &buf}, foo); + \\ @call(.{.stack = &buf}, foo, .{}); \\} \\fn foo() void {} , "tmp.zig:3:5: error: target arch 'wasm32' does not support calling with a new stack"); |
