diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index f1249afa97375ae7231c879a2a73259ea114be65..1d64468eb847ee8b1b87b01da2e0357bc3c0bd8c 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -94,6 +94,9 @@ pub fn format( args: var, ) Errors!void { const ArgSetType = @IntType(false, 32); + if (@typeInfo(@TypeOf(args)) != .Struct) { + @compileError("Expected tuple or struct argument, found " ++ @typeName(@TypeOf(args))); + } if (args.len > ArgSetType.bit_count) { @compileError("32 arguments max are supported per format call"); }