diff options
| author | Ryan Liptak <squeek502@hotmail.com> | 2024-05-02 20:20:41 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-06-13 10:18:59 -0400 |
| commit | 76fb2b685b202ea665b850338e353c7816f5b2bb (patch) | |
| tree | 16b4b39db7541febd2b4bf92c041239bdd45f144 /lib/std/Build/Cache/Path.zig | |
| parent | 4aa15440c7a12bcc6bc0cd589ade02295549d48c (diff) | |
| download | zig-76fb2b685b202ea665b850338e353c7816f5b2bb.tar.gz zig-76fb2b685b202ea665b850338e353c7816f5b2bb.zip | |
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/`
Diffstat (limited to 'lib/std/Build/Cache/Path.zig')
| -rw-r--r-- | lib/std/Build/Cache/Path.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/Build/Cache/Path.zig b/lib/std/Build/Cache/Path.zig index 99ce2e12ee..27dd15184b 100644 --- a/lib/std/Build/Cache/Path.zig +++ b/lib/std/Build/Cache/Path.zig @@ -49,7 +49,7 @@ pub fn openFile( sub_path: []const u8, flags: fs.File.OpenFlags, ) !fs.File { - var buf: [fs.MAX_PATH_BYTES]u8 = undefined; + var buf: [fs.max_path_bytes]u8 = undefined; const joined_path = if (p.sub_path.len == 0) sub_path else p: { break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ p.sub_path, sub_path, @@ -59,7 +59,7 @@ pub fn openFile( } pub fn makeOpenPath(p: Path, sub_path: []const u8, opts: fs.OpenDirOptions) !fs.Dir { - var buf: [fs.MAX_PATH_BYTES]u8 = undefined; + var buf: [fs.max_path_bytes]u8 = undefined; const joined_path = if (p.sub_path.len == 0) sub_path else p: { break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ p.sub_path, sub_path, @@ -69,7 +69,7 @@ pub fn makeOpenPath(p: Path, sub_path: []const u8, opts: fs.OpenDirOptions) !fs. } pub fn statFile(p: Path, sub_path: []const u8) !fs.Dir.Stat { - var buf: [fs.MAX_PATH_BYTES]u8 = undefined; + var buf: [fs.max_path_bytes]u8 = undefined; const joined_path = if (p.sub_path.len == 0) sub_path else p: { break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ p.sub_path, sub_path, @@ -82,7 +82,7 @@ pub fn atomicFile( p: Path, sub_path: []const u8, options: fs.Dir.AtomicFileOptions, - buf: *[fs.MAX_PATH_BYTES]u8, + buf: *[fs.max_path_bytes]u8, ) !fs.AtomicFile { const joined_path = if (p.sub_path.len == 0) sub_path else p: { break :p std.fmt.bufPrint(buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ @@ -93,7 +93,7 @@ pub fn atomicFile( } pub fn access(p: Path, sub_path: []const u8, flags: fs.File.OpenFlags) !void { - var buf: [fs.MAX_PATH_BYTES]u8 = undefined; + var buf: [fs.max_path_bytes]u8 = undefined; const joined_path = if (p.sub_path.len == 0) sub_path else p: { break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ p.sub_path, sub_path, @@ -103,7 +103,7 @@ pub fn access(p: Path, sub_path: []const u8, flags: fs.File.OpenFlags) !void { } pub fn makePath(p: Path, sub_path: []const u8) !void { - var buf: [fs.MAX_PATH_BYTES]u8 = undefined; + var buf: [fs.max_path_bytes]u8 = undefined; const joined_path = if (p.sub_path.len == 0) sub_path else p: { break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ p.sub_path, sub_path, |
