mirror of
https://github.com/ziglang/zig.git
synced 2026-10-14 10:27:43 -04:00
std: Convert deprecated aliases to compile errors and fix usages
Deprecated aliases that are now compile errors: - `std.fs.MAX_PATH_BYTES` (renamed to `std.fs.max_path_bytes`) - `std.mem.tokenize` (split into `tokenizeAny`, `tokenizeSequence`, `tokenizeScalar`) - `std.mem.split` (split into `splitSequence`, `splitAny`, `splitScalar`) - `std.mem.splitBackwards` (split into `splitBackwardsSequence`, `splitBackwardsAny`, `splitBackwardsScalar`) - `std.unicode` + `utf16leToUtf8Alloc`, `utf16leToUtf8AllocZ`, `utf16leToUtf8`, `fmtUtf16le` (all renamed to have capitalized `Le`) + `utf8ToUtf16LeWithNull` (renamed to `utf8ToUtf16LeAllocZ`) - `std.zig.CrossTarget` (moved to `std.Target.Query`) Deprecated `lib/std/std.zig` decls were deleted instead of made a `@compileError` because the `refAllDecls` in the test block would trigger the `@compileError`. The deleted top-level `std` namespaces are: - `std.rand` (renamed to `std.Random`) - `std.TailQueue` (renamed to `std.DoublyLinkedList`) - `std.ChildProcess` (renamed/moved to `std.process.Child`) This is not exhaustive. Deprecated aliases that I didn't touch: + `std.io.*` + `std.Build.*` + `std.builtin.Mode` + `std.zig.c_translation.CIntLiteralRadix` + anything in `src/`
This commit is contained in:
1 parent
4aa15440c7
commit
76fb2b685b
47 files changed
+136
-150
No files matched your search
@@ -1212,7 +1212,7 @@ fn unindent(s: []const u8, indent: usize) []const u8 {
|
||||
}
|
||||
|
||||
fn appendUnindented(out: *std.ArrayListUnmanaged(u8), s: []const u8, indent: usize) !void {
|
||||
var it = std.mem.split(u8, s, "\n");
|
||||
var it = std.mem.splitScalar(u8, s, '\n');
|
||||
var is_first_line = true;
|
||||
while (it.next()) |line| {
|
||||
if (is_first_line) {
|
||||
|
||||
@@ -1112,7 +1112,7 @@ fn testRender(input: []const u8, expected: []const u8) !void {
|
||||
var parser = try Parser.init(testing.allocator);
|
||||
defer parser.deinit();
|
||||
|
||||
var lines = std.mem.split(u8, input, "\n");
|
||||
var lines = std.mem.splitScalar(u8, input, '\n');
|
||||
while (lines.next()) |line| {
|
||||
try parser.feedLine(line);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user