diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-24 11:50:10 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-24 11:50:10 -0700 |
| commit | 934573fc5db1307caf559cc485e0e557a7c655e2 (patch) | |
| tree | 2e62419f306e5f77c7787a88dbc2c56c46f0f14e /doc | |
| parent | a08b0fa706f79a506b219d59a0b58a6d5761dcd7 (diff) | |
| download | zig-934573fc5db1307caf559cc485e0e557a7c655e2.tar.gz zig-934573fc5db1307caf559cc485e0e557a7c655e2.zip | |
Revert "std.fmt: require specifier for unwrapping ?T and E!T."
This reverts commit 7cbd586ace46a8e8cebab660ebca3cfc049305d9.
This is causing a fail to build from source:
```
./lib/std/fmt.zig:492:17: error: cannot format optional without a specifier (i.e. {?} or {any})
@compileError("cannot format optional without a specifier (i.e. {?} or {any})");
^
./src/link/MachO/Atom.zig:544:26: note: called from here
log.debug(" RELA({s}) @ {x} => %{d} in object({d})", .{
^
```
I looked at the code to fix it but none of those args are optionals.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.html.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index 81ccd58261..13c7da4a8a 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -574,7 +574,7 @@ pub fn main() void { var optional_value: ?[]const u8 = null; assert(optional_value == null); - print("\noptional 1\ntype: {s}\nvalue: {?s}\n", .{ + print("\noptional 1\ntype: {s}\nvalue: {s}\n", .{ @typeName(@TypeOf(optional_value)), optional_value, }); @@ -582,7 +582,7 @@ pub fn main() void { optional_value = "hi"; assert(optional_value != null); - print("\noptional 2\ntype: {s}\nvalue: {?s}\n", .{ + print("\noptional 2\ntype: {s}\nvalue: {s}\n", .{ @typeName(@TypeOf(optional_value)), optional_value, }); @@ -590,14 +590,14 @@ pub fn main() void { // error union var number_or_error: anyerror!i32 = error.ArgNotFound; - print("\nerror union 1\ntype: {s}\nvalue: {!}\n", .{ + print("\nerror union 1\ntype: {s}\nvalue: {}\n", .{ @typeName(@TypeOf(number_or_error)), number_or_error, }); number_or_error = 1234; - print("\nerror union 2\ntype: {s}\nvalue: {!}\n", .{ + print("\nerror union 2\ntype: {s}\nvalue: {}\n", .{ @typeName(@TypeOf(number_or_error)), number_or_error, }); |
