| author | |
| committer | |
| log | 8253b29cc5198a9f2b56b5274d766317efcffccb |
| tree | 2051b9109ce7eefe4ee3cf3b4cfd3a1f831bc284 |
| parent | 0d600e488f005a3823525779eeadf68ea6065427 |
3 files changed, 3 insertions(+), 3 deletions(-)
lib/std/Io/Writer.zig+1-1| ... | ... | @@ -1560,7 +1560,7 @@ fn printEnumNonexhaustive(w: *Writer, value: anytype) Error!void { |
| 1560 | 1560 | try w.writeVecAll(&vecs); |
| 1561 | 1561 | return; |
| 1562 | 1562 | } |
| 1563 | try w.writeAll("@enumFromInt("); | |
| 1563 | try w.writeAll("@fromBackingInt("); | |
| 1564 | 1564 | try w.printInt(@backingInt(value), 10, .lower, .{}); |
| 1565 | 1565 | try w.writeByte(')'); |
| 1566 | 1566 | } |
lib/std/Target.zig+1-1| ... | ... | @@ -324,7 +324,7 @@ pub const Os = struct { |
| 324 | 324 | var vecs: [2][]const u8 = .{ ".", name }; |
| 325 | 325 | return w.writeVecAll(&vecs); |
| 326 | 326 | } else { |
| 327 | return w.print("@enumFromInt(0x{X:0>8})", .{wv}); | |
| 327 | return w.print("@fromBackingInt(0x{X:0>8})", .{wv}); | |
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | }; |
lib/std/fmt.zig+1-1| ... | ... | @@ -947,7 +947,7 @@ test "non-exhaustive enum" { |
| 947 | 947 | }; |
| 948 | 948 | try expectFmt("enum: .One\n", "enum: {}\n", .{Enum.One}); |
| 949 | 949 | try expectFmt("enum: .Two\n", "enum: {}\n", .{Enum.Two}); |
| 950 | try expectFmt("enum: @enumFromInt(4660)\n", "enum: {}\n", .{@as(Enum, @fromBackingInt(@intCast(0x1234)))}); | |
| 950 | try expectFmt("enum: @fromBackingInt(4660)\n", "enum: {}\n", .{@as(Enum, @fromBackingInt(@intCast(0x1234)))}); | |
| 951 | 951 | try expectFmt("enum: f\n", "enum: {x}\n", .{Enum.One}); |
| 952 | 952 | try expectFmt("enum: beef\n", "enum: {x}\n", .{Enum.Two}); |
| 953 | 953 | try expectFmt("enum: BEEF\n", "enum: {X}\n", .{Enum.Two}); |