authorgravatar for josh@inv.alid.pwJosh Holland <josh@inv.alid.pw> 2020-11-06 18:57:26+00:00
committergravatar for josh@inv.alid.pwJosh Holland <josh@inv.alid.pw> 2020-11-07 11:15:47+00:00
loga1ec5448c77bee8d91c7e33d16416406b22fa159
tree6c57e49b9bf09fc60388a5e5873f54dae55b0869
parentc25b157ddaede518d92ee2d87ad536a5b6b097de

make ArrayList.span into a compile error


1 files changed, 1 insertions(+), 7 deletions(-)

lib/std/array_list.zig+1-7
...@@ -59,13 +59,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {...@@ -59,13 +59,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
59 self.allocator.free(self.allocatedSlice());59 self.allocator.free(self.allocatedSlice());
60 }60 }
6161
62 /// Deprecated: use `items` field directly.62 pub const span = @compileError("deprecated: use `items` field directly");
63 /// Return contents as a slice. Only valid while the list
64 /// doesn't change size.
65 pub fn span(self: anytype) @TypeOf(self.items) {
66 return self.items;
67 }
68
69 pub const toSlice = @compileError("deprecated: use `items` field directly");63 pub const toSlice = @compileError("deprecated: use `items` field directly");
70 pub const toSliceConst = @compileError("deprecated: use `items` field directly");64 pub const toSliceConst = @compileError("deprecated: use `items` field directly");
71 pub const at = @compileError("deprecated: use `list.items[i]`");65 pub const at = @compileError("deprecated: use `list.items[i]`");