@@ -4270,7 +4270,7 @@ test "using @typeInfo with runtime values" {
42704270}
42714271
42724272// Calls to `isFieldOptional` on `Struct1` get unrolled to an equivalent
4273- // of this function:
4273+ // of this function:
42744274fn isFieldOptionalUnrolled(field_index: usize) !bool {
42754275 return switch (field_index) {
42764276 0 => false,
@@ -7801,15 +7801,15 @@ comptime {
78017801 {#header_close#}
78027802
78037803 {#header_open|@call#}
7804- <pre>{#syntax#}@call(options : std.builtin.CallOptions , function: anytype, args: anytype) anytype{#endsyntax#}</pre>
7804+ <pre>{#syntax#}@call(modifier : std.builtin.CallModifier , function: anytype, args: anytype) anytype{#endsyntax#}</pre>
78057805 <p>
78067806 Calls a function, in the same way that invoking an expression with parentheses does:
78077807 </p>
78087808 {#code_begin|test|call#}
78097809const expect = @import("std").testing.expect;
78107810
78117811test "noinline function call" {
7812- try expect(@call(.{} , add, .{3, 9}) == 12);
7812+ try expect(@call(.auto , add, .{3, 9}) == 12);
78137813}
78147814
78157815fn add(a: i32, b: i32) i32 {
@@ -7818,48 +7818,41 @@ fn add(a: i32, b: i32) i32 {
78187818 {#code_end#}
78197819 <p>
78207820 {#syntax#}@call{#endsyntax#} allows more flexibility than normal function call syntax does. The
7821- {#syntax#}CallOptions {#endsyntax#} struct is reproduced here:
7821+ {#syntax#}CallModifier {#endsyntax#} enum is reproduced here:
78227822 </p>
7823- {#syntax_block|zig|builtin.CallOptions struct#}
7824- pub const CallOptions = struct {
7825- modifier: Modifier = .auto,
7826-
7827- /// Only valid when `Modifier` is `Modifier.async_kw`.
7828- stack: ?[]align(std.Target.stack_align) u8 = null,
7829-
7830- pub const Modifier = enum {
7831- /// Equivalent to function call syntax.
7832- auto,
7823+ {#syntax_block|zig|builtin.CallModifier struct#}
7824+ pub const CallModifier = enum {
7825+ /// Equivalent to function call syntax.
7826+ auto,
78337827
7834- /// Equivalent to async keyword used with function call syntax.
7835- async_kw,
7828+ /// Equivalent to async keyword used with function call syntax.
7829+ async_kw,
78367830
7837- /// Prevents tail call optimization. This guarantees that the return
7838- /// address will point to the callsite, as opposed to the callsite's
7839- /// callsite. If the call is otherwise required to be tail-called
7840- /// or inlined, a compile error is emitted instead.
7841- never_tail,
7831+ /// Prevents tail call optimization. This guarantees that the return
7832+ /// address will point to the callsite, as opposed to the callsite's
7833+ /// callsite. If the call is otherwise required to be tail-called
7834+ /// or inlined, a compile error is emitted instead.
7835+ never_tail,
78427836
7843- /// Guarantees that the call will not be inlined. If the call is
7844- /// otherwise required to be inlined, a compile error is emitted instead.
7845- never_inline,
7837+ /// Guarantees that the call will not be inlined. If the call is
7838+ /// otherwise required to be inlined, a compile error is emitted instead.
7839+ never_inline,
78467840
7847- /// Asserts that the function call will not suspend. This allows a
7848- /// non-async function to call an async function.
7849- no_async,
7841+ /// Asserts that the function call will not suspend. This allows a
7842+ /// non-async function to call an async function.
7843+ no_async,
78507844
7851- /// Guarantees that the call will be generated with tail call optimization.
7852- /// If this is not possible, a compile error is emitted instead.
7853- always_tail,
7845+ /// Guarantees that the call will be generated with tail call optimization.
7846+ /// If this is not possible, a compile error is emitted instead.
7847+ always_tail,
78547848
7855- /// Guarantees that the call will inlined at the callsite.
7856- /// If this is not possible, a compile error is emitted instead.
7857- always_inline,
7849+ /// Guarantees that the call will inlined at the callsite.
7850+ /// If this is not possible, a compile error is emitted instead.
7851+ always_inline,
78587852
7859- /// Evaluates the call at compile-time. If the call cannot be completed at
7860- /// compile-time, a compile error is emitted instead.
7861- compile_time,
7862- };
7853+ /// Evaluates the call at compile-time. If the call cannot be completed at
7854+ /// compile-time, a compile error is emitted instead.
7855+ compile_time,
78637856};
78647857 {#end_syntax_block#}
78657858 {#header_close#}
0 commit comments