zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 295b96f78b80cd4be2c0cdc230c7ed0b4a419e90 (tree)
parent 426e737292ffb3ec1d4c5780bd3c0511d4cdbc2b
Author: r00ster91 <r00ster91@proton.me>
Date:   Fri, 21 Jul 2023 23:03:26 +0200

langref builtin parameters: []u8 -> []const u8

None of these builtins modify the passed string.
This parameter type can be misleading.

Diffstat:
Mdoc/langref.html.in | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/langref.html.in b/doc/langref.html.in @@ -8041,7 +8041,7 @@ pub const CallModifier = enum { {#header_close#} {#header_open|@cDefine#} - <pre>{#syntax#}@cDefine(comptime name: []u8, value) void{#endsyntax#}</pre> + <pre>{#syntax#}@cDefine(comptime name: []const u8, value) void{#endsyntax#}</pre> <p> This function can only occur inside {#syntax#}@cImport{#endsyntax#}. </p> @@ -8085,7 +8085,7 @@ pub const CallModifier = enum { {#see_also|Import from C Header File|@cInclude|@cDefine|@cUndef#} {#header_close#} {#header_open|@cInclude#} - <pre>{#syntax#}@cInclude(comptime path: []u8) void{#endsyntax#}</pre> + <pre>{#syntax#}@cInclude(comptime path: []const u8) void{#endsyntax#}</pre> <p> This function can only occur inside {#syntax#}@cImport{#endsyntax#}. </p> @@ -8176,7 +8176,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val {#header_close#} {#header_open|@compileError#} - <pre>{#syntax#}@compileError(comptime msg: []u8) noreturn{#endsyntax#}</pre> + <pre>{#syntax#}@compileError(comptime msg: []const u8) noreturn{#endsyntax#}</pre> <p> This function, when semantically analyzed, causes a compile error with the message {#syntax#}msg{#endsyntax#}. @@ -8267,7 +8267,7 @@ test "main" { {#header_close#} {#header_open|@cUndef#} - <pre>{#syntax#}@cUndef(comptime name: []u8) void{#endsyntax#}</pre> + <pre>{#syntax#}@cUndef(comptime name: []const u8) void{#endsyntax#}</pre> <p> This function can only occur inside {#syntax#}@cImport{#endsyntax#}. </p> @@ -8607,7 +8607,7 @@ test "@hasDecl" { {#header_close#} {#header_open|@import#} - <pre>{#syntax#}@import(comptime path: []u8) type{#endsyntax#}</pre> + <pre>{#syntax#}@import(comptime path: []const u8) type{#endsyntax#}</pre> <p> This function finds a zig file corresponding to {#syntax#}path{#endsyntax#} and adds it to the build, if it is not already added.