diff options
| author | Nick Cernis <nick@cern.is> | 2022-11-12 20:03:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-12 21:03:24 +0200 |
| commit | 8a5818535b83ba87849cb09de9f1ccd32e8bb480 (patch) | |
| tree | 8b63ffe15c08edbe921d17594c5d333219937670 /lib/std/testing.zig | |
| parent | 32b97df50ea18a194ce9e14b267c99f146a3e2fd (diff) | |
| download | zig-8a5818535b83ba87849cb09de9f1ccd32e8bb480.tar.gz zig-8a5818535b83ba87849cb09de9f1ccd32e8bb480.zip | |
Make invalidFmtError public and use in place of compileErrors for bad format strings (#13526)
* Export invalidFmtErr
To allow consistent use of "invalid format string" compile error
response for badly formatted format strings.
See https://github.com/ziglang/zig/pull/13489#issuecomment-1311759340.
* Replace format compile errors with invalidFmtErr
- Provides more consistent compile errors.
- Gives user info about the type of the badly formated value.
* Rename invalidFmtErr as invalidFmtError
For consistency. Zig seems to use “Error” more often than “Err”.
* std: add invalid format string checks to remaining custom formatters
* pass reference-trace to comp when building build file; fix checkobjectstep
Diffstat (limited to 'lib/std/testing.zig')
| -rw-r--r-- | lib/std/testing.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 60a778ad7a..f1b01b0bd0 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -700,7 +700,7 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime error.OutOfMemory => { if (failing_allocator_inst.allocated_bytes != failing_allocator_inst.freed_bytes) { print( - "\nfail_index: {d}/{d}\nallocated bytes: {d}\nfreed bytes: {d}\nallocations: {d}\ndeallocations: {d}\nallocation that was made to fail: {s}", + "\nfail_index: {d}/{d}\nallocated bytes: {d}\nfreed bytes: {d}\nallocations: {d}\ndeallocations: {d}\nallocation that was made to fail: {}", .{ fail_index, needed_alloc_count, |
