diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-11-30 00:13:07 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-11-30 00:13:07 -0700 |
| commit | 902df103c6151c257c90de9ba5f29f7f4b9dbea2 (patch) | |
| tree | 16a522f3c8bbe34b56038d4810bf2487e32e2d85 /lib/std/array_hash_map.zig | |
| parent | 173d56213b60fc570b6ba3922ee1d40bbf0d0e36 (diff) | |
| download | zig-902df103c6151c257c90de9ba5f29f7f4b9dbea2.tar.gz zig-902df103c6151c257c90de9ba5f29f7f4b9dbea2.zip | |
std lib API deprecations for the upcoming 0.9.0 release
See #3811
Diffstat (limited to 'lib/std/array_hash_map.zig')
| -rw-r--r-- | lib/std/array_hash_map.zig | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/std/array_hash_map.zig b/lib/std/array_hash_map.zig index 83d5c73a00..e787abf1ef 100644 --- a/lib/std/array_hash_map.zig +++ b/lib/std/array_hash_map.zig @@ -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 { |
