From 27b73cc3958a5960691fd020551012bb6e3108d5 Mon Sep 17 00:00:00 2001 From: xackus <14938807+xackus@users.noreply.github.com> Date: Sun, 15 Nov 2020 11:53:23 +0100 Subject: [PATCH] std: make meta.IntType a compile error the function signature changed also update langref --- doc/langref.html.in | 4 ++-- lib/std/meta.zig | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index e456ccb6da..8ccaf2f4de 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -7460,7 +7460,7 @@ test "main" { {#header_close#} {#header_open|@errorToInt#} -
{#syntax#}@errorToInt(err: anytype) std.meta.IntType(false, @sizeOf(anyerror) * 8){#endsyntax#}
+
{#syntax#}@errorToInt(err: anytype) std.meta.Int(.unsigned, @sizeOf(anyerror) * 8){#endsyntax#}

Supports the following types:

@@ -7752,7 +7752,7 @@ test "@hasDecl" { {#header_close#} {#header_open|@intToError#} -
{#syntax#}@intToError(value: std.meta.IntType(false, @sizeOf(anyerror) * 8)) anyerror{#endsyntax#}
+
{#syntax#}@intToError(value: std.meta.Int(.unsigned, @sizeOf(anyerror) * 8)) anyerror{#endsyntax#}

Converts from the integer representation of an error into {#link|The Global Error Set#} type.

diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 4e03e1e60f..8b0f9a2738 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -675,8 +675,7 @@ pub fn declList(comptime Namespace: type, comptime Decl: type) []const *const De } } -/// Deprecated: use Int -pub const IntType = Int; +pub const IntType = @compileError("replaced by std.meta.Int"); pub const Signedness = enum { unsigned,