std lib API deprecations for the upcoming 0.9.0 release

See #3811
This commit is contained in:
Andrew Kelley
2021-11-30 00:13:07 -07:00
parent 173d56213b
commit 902df103c6
101 changed files with 1225 additions and 1561 deletions

View File

@@ -1,7 +1,6 @@
const std = @import("std.zig");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
const warn = std.debug.warn;
const Order = std.math.Order;
const testing = std.testing;
const expect = testing.expect;
@@ -355,8 +354,7 @@ pub fn PriorityDequeue(comptime T: type, comptime compareFn: fn (T, T) Order) ty
return queue;
}
/// Deprecated: call `ensureUnusedCapacity` or `ensureTotalCapacity`.
pub const ensureCapacity = ensureTotalCapacity;
pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
/// Ensure that the dequeue can fit at least `new_capacity` items.
pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) !void {
@@ -421,19 +419,20 @@ pub fn PriorityDequeue(comptime T: type, comptime compareFn: fn (T, T) Order) ty
}
fn dump(self: *Self) void {
warn("{{ ", .{});
warn("items: ", .{});
const print = std.debug.print;
print("{{ ", .{});
print("items: ", .{});
for (self.items) |e, i| {
if (i >= self.len) break;
warn("{}, ", .{e});
print("{}, ", .{e});
}
warn("array: ", .{});
print("array: ", .{});
for (self.items) |e| {
warn("{}, ", .{e});
print("{}, ", .{e});
}
warn("len: {} ", .{self.len});
warn("capacity: {}", .{self.capacity()});
warn(" }}\n", .{});
print("len: {} ", .{self.len});
print("capacity: {}", .{self.capacity()});
print(" }}\n", .{});
}
fn parentIndex(index: usize) usize {