From 295b96f78b80cd4be2c0cdc230c7ed0b4a419e90 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Fri, 21 Jul 2023 23:03:26 +0200 Subject: [PATCH] langref builtin parameters: []u8 -> []const u8 None of these builtins modify the passed string. This parameter type can be misleading. --- doc/langref.html.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index e4b318929d..4307dd72e6 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -8041,7 +8041,7 @@ pub const CallModifier = enum { {#header_close#} {#header_open|@cDefine#} -
{#syntax#}@cDefine(comptime name: []u8, value) void{#endsyntax#}
+
{#syntax#}@cDefine(comptime name: []const u8, value) void{#endsyntax#}

This function can only occur inside {#syntax#}@cImport{#endsyntax#}.

@@ -8085,7 +8085,7 @@ pub const CallModifier = enum { {#see_also|Import from C Header File|@cInclude|@cDefine|@cUndef#} {#header_close#} {#header_open|@cInclude#} -
{#syntax#}@cInclude(comptime path: []u8) void{#endsyntax#}
+
{#syntax#}@cInclude(comptime path: []const u8) void{#endsyntax#}

This function can only occur inside {#syntax#}@cImport{#endsyntax#}.

@@ -8176,7 +8176,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val {#header_close#} {#header_open|@compileError#} -
{#syntax#}@compileError(comptime msg: []u8) noreturn{#endsyntax#}
+
{#syntax#}@compileError(comptime msg: []const u8) noreturn{#endsyntax#}

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#} -

{#syntax#}@cUndef(comptime name: []u8) void{#endsyntax#}
+
{#syntax#}@cUndef(comptime name: []const u8) void{#endsyntax#}

This function can only occur inside {#syntax#}@cImport{#endsyntax#}.

@@ -8607,7 +8607,7 @@ test "@hasDecl" { {#header_close#} {#header_open|@import#} -
{#syntax#}@import(comptime path: []u8) type{#endsyntax#}
+
{#syntax#}@import(comptime path: []const u8) type{#endsyntax#}

This function finds a zig file corresponding to {#syntax#}path{#endsyntax#} and adds it to the build, if it is not already added.