authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-05 11:03:54-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-05 11:03:54-07:00
log6b5d0b371111fd458e7fd0a1500f0d93914b5db1
tree01f263b5816e7293fc46e1cf53ec120d2c1395bb
parentfc40d2372335e69be175972ffabb55bc7fb77230

std: fix compile errors found by stage2

* redundant `comptime` * `try` outside function * `extern enum`

4 files changed, 6 insertions(+), 6 deletions(-)

lib/std/crypto/pcurves/common.zig+1-1
...@@ -43,7 +43,7 @@ pub fn Field(comptime params: FieldParams) type {...@@ -43,7 +43,7 @@ pub fn Field(comptime params: FieldParams) type {
43 pub const zero: Fe = Fe{ .limbs = mem.zeroes(Limbs) };43 pub const zero: Fe = Fe{ .limbs = mem.zeroes(Limbs) };
4444
45 /// One.45 /// One.
46 pub const one = comptime one: {46 pub const one = one: {
47 var fe: Fe = undefined;47 var fe: Fe = undefined;
48 fiat.setOne(&fe.limbs);48 fiat.setOne(&fe.limbs);
49 break :one fe;49 break :one fe;
lib/std/crypto/pcurves/p256.zig+3-3
...@@ -30,8 +30,8 @@ pub const P256 = struct {...@@ -30,8 +30,8 @@ pub const P256 = struct {
3030
31 /// The P256 base point.31 /// The P256 base point.
32 pub const basePoint = P256{32 pub const basePoint = P256{
33 .x = try Fe.fromInt(48439561293906451759052585252797914202762949526041747995844080717082404635286),33 .x = Fe.fromInt(48439561293906451759052585252797914202762949526041747995844080717082404635286) catch unreachable,
34 .y = try Fe.fromInt(36134250956749795798585127919587881956611106672985015071877198253568414405109),34 .y = Fe.fromInt(36134250956749795798585127919587881956611106672985015071877198253568414405109) catch unreachable,
35 .z = Fe.one,35 .z = Fe.one,
36 .is_base = true,36 .is_base = true,
37 };37 };
...@@ -39,7 +39,7 @@ pub const P256 = struct {...@@ -39,7 +39,7 @@ pub const P256 = struct {
39 /// The P256 neutral element.39 /// The P256 neutral element.
40 pub const identityElement = P256{ .x = Fe.zero, .y = Fe.one, .z = Fe.zero };40 pub const identityElement = P256{ .x = Fe.zero, .y = Fe.one, .z = Fe.zero };
4141
42 pub const B = try Fe.fromInt(41058363725152142129326129780047268409114441015993725554835256314039467401291);42 pub const B = Fe.fromInt(41058363725152142129326129780047268409114441015993725554835256314039467401291) catch unreachable;
4343
44 /// Reject the neutral element.44 /// Reject the neutral element.
45 pub fn rejectIdentity(p: P256) IdentityElementError!void {45 pub fn rejectIdentity(p: P256) IdentityElementError!void {
lib/std/x/net/tcp.zig+1-1
...@@ -49,7 +49,7 @@ pub const Connection = struct {...@@ -49,7 +49,7 @@ pub const Connection = struct {
49};49};
5050
51/// Possible domains that a TCP client/listener may operate over.51/// Possible domains that a TCP client/listener may operate over.
52pub const Domain = extern enum(u16) {52pub const Domain = enum(u16) {
53 ip = os.AF_INET,53 ip = os.AF_INET,
54 ipv6 = os.AF_INET6,54 ipv6 = os.AF_INET6,
55};55};
lib/std/x/os/net.zig+1-1
...@@ -343,7 +343,7 @@ pub const IPv6 = extern struct {...@@ -343,7 +343,7 @@ pub const IPv6 = extern struct {
343 opts: fmt.FormatOptions,343 opts: fmt.FormatOptions,
344 writer: anytype,344 writer: anytype,
345 ) !void {345 ) !void {
346 comptime const specifier = &[_]u8{if (layout.len == 0) 'x' else switch (layout[0]) {346 const specifier = comptime &[_]u8{if (layout.len == 0) 'x' else switch (layout[0]) {
347 'x', 'X' => |specifier| specifier,347 'x', 'X' => |specifier| specifier,
348 's' => 'x',348 's' => 'x',
349 'S' => 'X',349 'S' => 'X',