diff options
Diffstat (limited to 'src/rollback.zig')
| -rw-r--r-- | src/rollback.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rollback.zig b/src/rollback.zig index 6496a69f..7216664c 100644 --- a/src/rollback.zig +++ b/src/rollback.zig @@ -305,7 +305,8 @@ pub const Copy = struct { // by a speculation: terminal.zig's guards). if (comptime @hasDecl(T, "digest") and @TypeOf(T.digest) == fn (*const T, *walk.Hasher) void) return; if (s.layout == .@"packed") return; - if (comptime @hasField(T, "items") and @hasField(T, "capacity") and s.field_names.len == 2) { + // std's lists (a safe build's have a third field, a lock). + if (comptime walk.isList(T)) { if (v.capacity == 0) return; _ = try c.allocation(@intFromPtr(v.items.ptr)); const E = @typeInfo(@FieldType(T, "items")).pointer.child; |
