Commit 4fcdb08390

Josh Wolfe <thejoshwolfe@gmail.com>
2025-08-15 23:04:39
[std] fix compile error in std.Io.Writer.failing
1 parent 99c4890
Changed files (1)
lib
std
lib/std/Io/Writer.zig
@@ -141,8 +141,14 @@ pub const failing: Writer = .{
         .sendFile = failingSendFile,
         .rebase = failingRebase,
     },
+    .buffer = &.{},
 };
 
+test failing {
+    var fw: Writer = .failing;
+    try testing.expectError(error.WriteFailed, fw.writeAll("always fails"));
+}
+
 /// Returns the contents not yet drained.
 pub fn buffered(w: *const Writer) []u8 {
     return w.buffer[0..w.end];