Skip to content

std: remove remaining mentions of #425 #16968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/std/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub const Token = tokenizer.Token;
pub const Tokenizer = tokenizer.Tokenizer;

/// The return type is `type` to force comptime function call execution.
/// TODO: https://github.com/ziglang/zig/issues/425
/// If not linking libc, returns struct{pub const ok = false;}
/// If linking musl libc, returns struct{pub const ok = true;}
/// If linking gnu libc (glibc), the `ok` value will be true if the target
Expand Down
1 change: 0 additions & 1 deletion lib/std/meta.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,6 @@ test "ArgsTuple forwarding" {
}
}

/// TODO: https://github.com/ziglang/zig/issues/425
pub fn globalOption(comptime name: []const u8, comptime T: type) ?T {
if (!@hasDecl(root, name))
return null;
Expand Down
20 changes: 4 additions & 16 deletions lib/std/unicode.zig
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,6 @@ pub const Utf8View = struct {
return Utf8View{ .bytes = s };
}

/// TODO: https://github.com/ziglang/zig/issues/425
pub fn initComptime(comptime s: []const u8) Utf8View {
if (comptime init(s)) |r| {
return r;
} else |err| switch (err) {
error.InvalidUtf8 => {
@compileError("invalid utf8");
},
}
}

pub fn iterator(s: Utf8View) Utf8Iterator {
return Utf8Iterator{
.bytes = s.bytes,
Expand Down Expand Up @@ -457,7 +446,7 @@ test "utf8 iterator on ascii" {
try testUtf8IteratorOnAscii();
}
fn testUtf8IteratorOnAscii() !void {
const s = Utf8View.initComptime("abc");
const s = try Utf8View.init("abc");

var it1 = s.iterator();
try testing.expect(std.mem.eql(u8, "a", it1.nextCodepointSlice().?));
Expand All @@ -477,8 +466,7 @@ test "utf8 view bad" {
try testUtf8ViewBad();
}
fn testUtf8ViewBad() !void {
// Compile-time error.
// const s3 = Utf8View.initComptime("\xfe\xf2");
try testing.expectError(error.InvalidUtf8, Utf8View.init("\xfe\xf2"));
try testing.expectError(error.InvalidUtf8, Utf8View.init("hel\xadlo"));
}

Expand All @@ -487,7 +475,7 @@ test "utf8 view ok" {
try testUtf8ViewOk();
}
fn testUtf8ViewOk() !void {
const s = Utf8View.initComptime("東京市");
const s = try Utf8View.init("東京市");

var it1 = s.iterator();
try testing.expect(std.mem.eql(u8, "東", it1.nextCodepointSlice().?));
Expand Down Expand Up @@ -598,7 +586,7 @@ test "utf8 iterator peeking" {
}

fn testUtf8Peeking() !void {
const s = Utf8View.initComptime("noël");
const s = try Utf8View.init("noël");
var it = s.iterator();

try testing.expect(std.mem.eql(u8, "n", it.nextCodepointSlice().?));
Expand Down