diff --git a/doc/langref.html.in b/doc/langref.html.in index ab1f3e89f99e..446a201bbec5 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -1019,7 +1019,7 @@ a +%= b{#endsyntax#} -
{#syntax#}u32(std.math.maxInt(u32)) +% 1 == 0{#endsyntax#}
+
{#syntax#}@as(u32, std.math.maxInt(u32)) +% 1 == 0{#endsyntax#}
@@ -1058,7 +1058,7 @@ a -%= b{#endsyntax#} -
{#syntax#}u32(0) -% 1 == std.math.maxInt(u32){#endsyntax#}
+
{#syntax#}@as(u32, 0) -% 1 == std.math.maxInt(u32){#endsyntax#}
@@ -1093,7 +1093,7 @@ a -%= b{#endsyntax#} -
{#syntax#}-%i32(std.math.minInt(i32)) == std.math.minInt(i32){#endsyntax#}
+
{#syntax#}-%@as(i32, std.math.minInt(i32)) == std.math.minInt(i32){#endsyntax#}
@@ -1132,7 +1132,7 @@ a *%= b{#endsyntax#} -
{#syntax#}u8(200) *% 2 == 144{#endsyntax#}
+
{#syntax#}@as(u8, 200) *% 2 == 144{#endsyntax#}
@@ -1284,7 +1284,7 @@ a ^= b{#endsyntax#} Bitwise NOT. -
{#syntax#}~u8(0b10101111) == 0b01010000{#endsyntax#}
+
{#syntax#}~@as(u8, 0b10101111) == 0b01010000{#endsyntax#}
@@ -7947,7 +7947,7 @@ test "@setRuntimeSafety" { {#syntax#}b{#endsyntax#}. Positive numbers select from {#syntax#}a{#endsyntax#} starting at 0. Negative values select from {#syntax#}b{#endsyntax#}, starting at {#syntax#}-1{#endsyntax#} and going down. It is recommended to use the {#syntax#}~{#endsyntax#} operator from indexes from {#syntax#}b{#endsyntax#} - so that both indexes can start from {#syntax#}0{#endsyntax#} (i.e. {#syntax#}~i32(0){#endsyntax#} is + so that both indexes can start from {#syntax#}0{#endsyntax#} (i.e. {#syntax#}~@as(i32, 0){#endsyntax#} is {#syntax#}-1{#endsyntax#}).

diff --git a/tools/process_headers.zig b/tools/process_headers.zig index 3a56cab162f3..fd39cb93addb 100644 --- a/tools/process_headers.zig +++ b/tools/process_headers.zig @@ -226,8 +226,8 @@ const DestTarget = struct { fn hash(a: DestTarget) u32 { return @enumToInt(a.arch) +% - (@enumToInt(a.os) *% u32(4202347608)) +% - (@enumToInt(a.abi) *% u32(4082223418)); + (@enumToInt(a.os) *% @as(u32, 4202347608)) +% + (@enumToInt(a.abi) *% @as(u32, 4082223418)); } fn eql(a: DestTarget, b: DestTarget) bool {