mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 15:12:31 +00:00
langref builtin parameters: []u8 -> []const u8
None of these builtins modify the passed string. This parameter type can be misleading.
This commit is contained in:
parent
426e737292
commit
295b96f78b
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user