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

@@ -201,8 +201,7 @@ pub fn ArrayHashMap(
return self.unmanaged.getOrPutValueContext(self.allocator, key, value, self.ctx);
}
/// Deprecated: call `ensureUnusedCapacity` or `ensureTotalCapacity`.
pub const ensureCapacity = ensureTotalCapacity;
pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
/// Increases capacity, guaranteeing that insertions up until the
/// `expected_count` will not cause an allocation, and therefore cannot fail.
@@ -746,8 +745,7 @@ pub fn ArrayHashMapUnmanaged(
return res;
}
/// Deprecated: call `ensureUnusedCapacity` or `ensureTotalCapacity`.
pub const ensureCapacity = ensureTotalCapacity;
pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
/// Increases capacity, guaranteeing that insertions up until the
/// `expected_count` will not cause an allocation, and therefore cannot fail.
@@ -2217,17 +2215,6 @@ test "auto store_hash" {
try testing.expect(meta.fieldInfo(HasExpensiveEqlUn.Data, .hash).field_type != void);
}
test "compile everything" {
std.testing.refAllDecls(AutoArrayHashMap(i32, i32));
std.testing.refAllDecls(StringArrayHashMap([]const u8));
std.testing.refAllDecls(AutoArrayHashMap(i32, void));
std.testing.refAllDecls(StringArrayHashMap(u0));
std.testing.refAllDecls(AutoArrayHashMapUnmanaged(i32, i32));
std.testing.refAllDecls(StringArrayHashMapUnmanaged([]const u8));
std.testing.refAllDecls(AutoArrayHashMapUnmanaged(i32, void));
std.testing.refAllDecls(StringArrayHashMapUnmanaged(u0));
}
pub fn getHashPtrAddrFn(comptime K: type, comptime Context: type) (fn (Context, K) u32) {
return struct {
fn hash(ctx: Context, key: K) u32 {