diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-06-27 20:05:22 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-07-07 22:43:51 -0700 |
| commit | 0e37ff0d591dd75ceec9208196bec29efaec607a (patch) | |
| tree | c126fa823a1f3864e9c363aac70e3a3db0219957 /src/libs | |
| parent | 0b3f0124dc33403d329fb8ee63a93215d9af1f1e (diff) | |
| download | zig-0e37ff0d591dd75ceec9208196bec29efaec607a.tar.gz zig-0e37ff0d591dd75ceec9208196bec29efaec607a.zip | |
std.fmt: breaking API changes
added adapter to AnyWriter and GenericWriter to help bridge the gap
between old and new API
make std.testing.expectFmt work at compile-time
std.fmt no longer has a dependency on std.unicode. Formatted printing
was never properly unicode-aware. Now it no longer pretends to be.
Breakage/deprecations:
* std.fs.File.reader -> std.fs.File.deprecatedReader
* std.fs.File.writer -> std.fs.File.deprecatedWriter
* std.io.GenericReader -> std.io.Reader
* std.io.GenericWriter -> std.io.Writer
* std.io.AnyReader -> std.io.Reader
* std.io.AnyWriter -> std.io.Writer
* std.fmt.format -> std.fmt.deprecatedFormat
* std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape
* std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape
* std.fmt.fmtSliceHexLower -> {x}
* std.fmt.fmtSliceHexUpper -> {X}
* std.fmt.fmtIntSizeDec -> {B}
* std.fmt.fmtIntSizeBin -> {Bi}
* std.fmt.fmtDuration -> {D}
* std.fmt.fmtDurationSigned -> {D}
* {} -> {f} when there is a format method
* format method signature
- anytype -> *std.io.Writer
- inferred error set -> error{WriteFailed}
- options -> (deleted)
* std.fmt.Formatted
- now takes context type explicitly
- no fmt string
Diffstat (limited to 'src/libs')
| -rw-r--r-- | src/libs/libtsan.zig | 2 | ||||
| -rw-r--r-- | src/libs/mingw.zig | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/libtsan.zig b/src/libs/libtsan.zig index de5a770e30..d17baf8fa1 100644 --- a/src/libs/libtsan.zig +++ b/src/libs/libtsan.zig @@ -268,7 +268,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo const skip_linker_dependencies = !target.os.tag.isDarwin(); const linker_allow_shlib_undefined = target.os.tag.isDarwin(); const install_name = if (target.os.tag.isDarwin()) - try std.fmt.allocPrintZ(arena, "@rpath/{s}", .{basename}) + try std.fmt.allocPrintSentinel(arena, "@rpath/{s}", .{basename}, 0) else null; // Workaround for https://github.com/llvm/llvm-project/issues/97627 diff --git a/src/libs/mingw.zig b/src/libs/mingw.zig index e2bcb19f08..1c2927eba0 100644 --- a/src/libs/mingw.zig +++ b/src/libs/mingw.zig @@ -306,7 +306,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { if (comp.verbose_cc) print: { std.debug.lockStdErr(); defer std.debug.unlockStdErr(); - const stderr = std.fs.File.stderr().writer(); + const stderr = std.fs.File.stderr().deprecatedWriter(); nosuspend stderr.print("def file: {s}\n", .{def_file_path}) catch break :print; nosuspend stderr.print("include dir: {s}\n", .{include_dir}) catch break :print; nosuspend stderr.print("output path: {s}\n", .{def_final_path}) catch break :print; @@ -335,7 +335,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { // new scope to ensure definition file is written before passing the path to WriteImportLibrary const def_final_file = try o_dir.createFile(final_def_basename, .{ .truncate = true }); defer def_final_file.close(); - try pp.prettyPrintTokens(def_final_file.writer(), .result_only); + try pp.prettyPrintTokens(def_final_file.deprecatedWriter(), .result_only); } const lib_final_path = try std.fs.path.join(gpa, &.{ "o", &digest, final_lib_basename }); |
