diff --git a/lib/std/crypto/argon2.zig b/lib/std/crypto/argon2.zig index 16c20a4a78..7269470d5f 100644 --- a/lib/std/crypto/argon2.zig +++ b/lib/std/crypto/argon2.zig @@ -897,7 +897,6 @@ test "kdf" { } test "phc format hasher" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO const allocator = std.testing.allocator; const password = "testpass"; @@ -913,7 +912,6 @@ test "phc format hasher" { } test "password hash and password verify" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO const allocator = std.testing.allocator; const password = "testpass"; diff --git a/lib/std/crypto/bcrypt.zig b/lib/std/crypto/bcrypt.zig index d5e9fddaf1..d7a0e0fb80 100644 --- a/lib/std/crypto/bcrypt.zig +++ b/lib/std/crypto/bcrypt.zig @@ -802,7 +802,6 @@ test "bcrypt crypt format" { } test "bcrypt phc format" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO const hash_options = HashOptions{ .params = .{ .rounds_log = 5 }, .encoding = .phc, diff --git a/lib/std/crypto/phc_encoding.zig b/lib/std/crypto/phc_encoding.zig index 40074b2c6e..69324dc5b3 100644 --- a/lib/std/crypto/phc_encoding.zig +++ b/lib/std/crypto/phc_encoding.zig @@ -41,7 +41,7 @@ pub fn BinValue(comptime max_len: usize) type { } /// Return the slice containing the actual value. - pub fn constSlice(self: Self) []const u8 { + pub fn constSlice(self: *const Self) []const u8 { return self.buf[0..self.len]; } @@ -52,7 +52,7 @@ pub fn BinValue(comptime max_len: usize) type { self.len = len; } - fn toB64(self: Self, buf: []u8) ![]const u8 { + fn toB64(self: *const Self, buf: []u8) ![]const u8 { const value = self.constSlice(); const len = B64Encoder.calcSize(value.len); if (len > buf.len) return Error.NoSpaceLeft; @@ -260,7 +260,6 @@ fn kvSplit(str: []const u8) !struct { key: []const u8, value: []const u8 } { } test "phc format - encoding/decoding" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO const Input = struct { str: []const u8, HashResult: type, diff --git a/lib/std/crypto/scrypt.zig b/lib/std/crypto/scrypt.zig index 11441df161..35049ebc51 100644 --- a/lib/std/crypto/scrypt.zig +++ b/lib/std/crypto/scrypt.zig @@ -248,7 +248,7 @@ const crypt_format = struct { } /// Return the slice containing the actual value. - pub fn constSlice(self: Self) []const u8 { + pub fn constSlice(self: *const Self) []const u8 { return self.buf[0..self.len]; } @@ -259,7 +259,7 @@ const crypt_format = struct { self.len = len; } - fn toB64(self: Self, buf: []u8) ![]const u8 { + fn toB64(self: *const Self, buf: []u8) ![]const u8 { const value = self.constSlice(); const len = Codec.encodedLen(value.len); if (len > buf.len) return EncodingError.NoSpaceLeft; @@ -683,7 +683,6 @@ test "unix-scrypt" { } test "crypt format" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO const str = "$7$C6..../....SodiumChloride$kBGj9fHznVYFQMEn/qDCfrDevf9YDtcDdKvEqHJLV8D"; const params = try crypt_format.deserialize(crypt_format.HashResult(32), str); var buf: [str.len]u8 = undefined; diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index 449cc6a919..b49a954800 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -2117,18 +2117,18 @@ test "escape non-printable" { } test "pointer" { + if (builtin.zig_backend == .stage1) return error.SkipZigTest; { const value = @intToPtr(*align(1) i32, 0xdeadbeef); try expectFmt("pointer: i32@deadbeef\n", "pointer: {}\n", .{value}); try expectFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value}); } - if (builtin.zig_backend != .stage1) return error.SkipZigTest; { - const value = @intToPtr(fn () void, 0xdeadbeef); + const value = @intToPtr(*const fn () void, 0xdeadbeef); try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); } { - const value = @intToPtr(fn () void, 0xdeadbeef); + const value = @intToPtr(*const fn () void, 0xdeadbeef); try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); } } diff --git a/lib/std/mem.zig b/lib/std/mem.zig index 7c8e914b57..61d6b84874 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -2080,7 +2080,6 @@ fn testReadIntImpl() !void { } test "writeIntSlice" { - if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO try testWriteIntImpl(); comptime try testWriteIntImpl(); } diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 949e2a67f2..54c0dfb3c7 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -225,9 +225,6 @@ fn formatIdent( } pub fn fmtIdent(ident: []const u8) std.fmt.Formatter(formatIdent) { - if (builtin.zig_backend != .stage1) { - @panic("TODO"); - } return .{ .data = ident }; } diff --git a/src/value.zig b/src/value.zig index 60c212a84f..e5332a72e7 100644 --- a/src/value.zig +++ b/src/value.zig @@ -2414,6 +2414,7 @@ pub const Value = extern union { return false; }, .@"union" => return val.cast(Payload.Union).?.data.val.canMutateComptimeVarState(), + .slice => return val.castTag(.slice).?.data.ptr.canMutateComptimeVarState(), else => return false, } }