authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-15 19:40:04-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-16 14:46:53-04:00
logd3d24874c91054a70c706fed47278c81c9ce890a
tree6ee731cf3c9acaac8292bd2701cafc6dee9e0d4d
parent7b32aacbafda2946c67ff4d4b329cdededf1da29

std: remove deprecated API for the upcoming release

See #3811

16 files changed, 8 insertions(+), 94 deletions(-)

lib/std/array_hash_map.zig-4
...@@ -201,8 +201,6 @@ pub fn ArrayHashMap(...@@ -201,8 +201,6 @@ pub fn ArrayHashMap(
201 return self.unmanaged.getOrPutValueContext(self.allocator, key, value, self.ctx);201 return self.unmanaged.getOrPutValueContext(self.allocator, key, value, self.ctx);
202 }202 }
203203
204 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
205
206 /// Increases capacity, guaranteeing that insertions up until the204 /// Increases capacity, guaranteeing that insertions up until the
207 /// `expected_count` will not cause an allocation, and therefore cannot fail.205 /// `expected_count` will not cause an allocation, and therefore cannot fail.
208 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) !void {206 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) !void {
...@@ -755,8 +753,6 @@ pub fn ArrayHashMapUnmanaged(...@@ -755,8 +753,6 @@ pub fn ArrayHashMapUnmanaged(
755 return res;753 return res;
756 }754 }
757755
758 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
759
760 /// Increases capacity, guaranteeing that insertions up until the756 /// Increases capacity, guaranteeing that insertions up until the
761 /// `expected_count` will not cause an allocation, and therefore cannot fail.757 /// `expected_count` will not cause an allocation, and therefore cannot fail.
762 pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_capacity: usize) !void {758 pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_capacity: usize) !void {
lib/std/array_list.zig-6
...@@ -83,8 +83,6 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {...@@ -83,8 +83,6 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
83 };83 };
84 }84 }
8585
86 pub const toUnmanaged = @compileError("deprecated; use `moveToUnmanaged` which has different semantics.");
87
88 /// Initializes an ArrayListUnmanaged with the `items` and `capacity` fields86 /// Initializes an ArrayListUnmanaged with the `items` and `capacity` fields
89 /// of this ArrayList. Empties this ArrayList.87 /// of this ArrayList. Empties this ArrayList.
90 pub fn moveToUnmanaged(self: *Self) ArrayListAlignedUnmanaged(T, alignment) {88 pub fn moveToUnmanaged(self: *Self) ArrayListAlignedUnmanaged(T, alignment) {
...@@ -325,8 +323,6 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {...@@ -325,8 +323,6 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
325 self.capacity = 0;323 self.capacity = 0;
326 }324 }
327325
328 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
329
330 /// Modify the array so that it can hold at least `new_capacity` items.326 /// Modify the array so that it can hold at least `new_capacity` items.
331 /// Invalidates pointers if additional memory is needed.327 /// Invalidates pointers if additional memory is needed.
332 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) Allocator.Error!void {328 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) Allocator.Error!void {
...@@ -721,8 +717,6 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ...@@ -721,8 +717,6 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ
721 self.capacity = 0;717 self.capacity = 0;
722 }718 }
723719
724 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
725
726 /// Modify the array so that it can hold at least `new_capacity` items.720 /// Modify the array so that it can hold at least `new_capacity` items.
727 /// Invalidates pointers if additional memory is needed.721 /// Invalidates pointers if additional memory is needed.
728 pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_capacity: usize) Allocator.Error!void {722 pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_capacity: usize) Allocator.Error!void {
lib/std/base64.zig-4
...@@ -69,10 +69,6 @@ pub const url_safe_no_pad = Codecs{...@@ -69,10 +69,6 @@ pub const url_safe_no_pad = Codecs{
69 .Decoder = Base64Decoder.init(url_safe_alphabet_chars, null),69 .Decoder = Base64Decoder.init(url_safe_alphabet_chars, null),
70};70};
7171
72pub const standard_pad_char = @compileError("deprecated; use standard.pad_char");
73pub const standard_encoder = @compileError("deprecated; use standard.Encoder");
74pub const standard_decoder = @compileError("deprecated; use standard.Decoder");
75
76pub const Base64Encoder = struct {72pub const Base64Encoder = struct {
77 alphabet_chars: [64]u8,73 alphabet_chars: [64]u8,
78 pad_char: ?u8,74 pad_char: ?u8,
lib/std/build.zig+4-26
...@@ -1339,13 +1339,6 @@ test "builder.findProgram compiles" {...@@ -1339,13 +1339,6 @@ test "builder.findProgram compiles" {
1339 _ = builder.findProgram(&[_][]const u8{}, &[_][]const u8{}) catch null;1339 _ = builder.findProgram(&[_][]const u8{}, &[_][]const u8{}) catch null;
1340}1340}
13411341
1342/// TODO: propose some kind of `@deprecate` builtin so that we can deprecate
1343/// this while still having somewhat non-lazy decls. In this file we wanted to do
1344/// refAllDecls for example which makes it trigger `@compileError` if you try
1345/// to use that strategy.
1346pub const Version = @compileError("deprecated; Use `std.builtin.Version`");
1347pub const Target = @compileError("deprecated; Use `std.zig.CrossTarget`");
1348
1349pub const Pkg = struct {1342pub const Pkg = struct {
1350 name: []const u8,1343 name: []const u8,
1351 source: FileSource,1344 source: FileSource,
...@@ -2314,29 +2307,19 @@ pub const LibExeObjStep = struct {...@@ -2314,29 +2307,19 @@ pub const LibExeObjStep = struct {
2314 self.linkLibraryOrObject(obj);2307 self.linkLibraryOrObject(obj);
2315 }2308 }
23162309
2317 /// TODO deprecated, use `addSystemIncludePath`.2310 pub const addSystemIncludeDir = @compileError("deprecated; use addSystemIncludePath");
2318 pub fn addSystemIncludeDir(self: *LibExeObjStep, path: []const u8) void {2311 pub const addIncludeDir = @compileError("deprecated; use addIncludePath");
2319 self.addSystemIncludePath(path);2312 pub const addLibPath = @compileError("deprecated, use addLibraryPath");
2320 }2313 pub const addFrameworkDir = @compileError("deprecated, use addFrameworkPath");
23212314
2322 pub fn addSystemIncludePath(self: *LibExeObjStep, path: []const u8) void {2315 pub fn addSystemIncludePath(self: *LibExeObjStep, path: []const u8) void {
2323 self.include_dirs.append(IncludeDir{ .raw_path_system = self.builder.dupe(path) }) catch unreachable;2316 self.include_dirs.append(IncludeDir{ .raw_path_system = self.builder.dupe(path) }) catch unreachable;
2324 }2317 }
23252318
2326 /// TODO deprecated, use `addIncludePath`.
2327 pub fn addIncludeDir(self: *LibExeObjStep, path: []const u8) void {
2328 self.addIncludePath(path);
2329 }
2330
2331 pub fn addIncludePath(self: *LibExeObjStep, path: []const u8) void {2319 pub fn addIncludePath(self: *LibExeObjStep, path: []const u8) void {
2332 self.include_dirs.append(IncludeDir{ .raw_path = self.builder.dupe(path) }) catch unreachable;2320 self.include_dirs.append(IncludeDir{ .raw_path = self.builder.dupe(path) }) catch unreachable;
2333 }2321 }
23342322
2335 /// TODO deprecated, use `addLibraryPath`.
2336 pub fn addLibPath(self: *LibExeObjStep, path: []const u8) void {
2337 self.addLibraryPath(path);
2338 }
2339
2340 pub fn addLibraryPath(self: *LibExeObjStep, path: []const u8) void {2323 pub fn addLibraryPath(self: *LibExeObjStep, path: []const u8) void {
2341 self.lib_paths.append(self.builder.dupe(path)) catch unreachable;2324 self.lib_paths.append(self.builder.dupe(path)) catch unreachable;
2342 }2325 }
...@@ -2345,11 +2328,6 @@ pub const LibExeObjStep = struct {...@@ -2345,11 +2328,6 @@ pub const LibExeObjStep = struct {
2345 self.rpaths.append(self.builder.dupe(path)) catch unreachable;2328 self.rpaths.append(self.builder.dupe(path)) catch unreachable;
2346 }2329 }
23472330
2348 /// TODO deprecated, use `addFrameworkPath`.
2349 pub fn addFrameworkDir(self: *LibExeObjStep, dir_path: []const u8) void {
2350 self.addFrameworkPath(dir_path);
2351 }
2352
2353 pub fn addFrameworkPath(self: *LibExeObjStep, dir_path: []const u8) void {2331 pub fn addFrameworkPath(self: *LibExeObjStep, dir_path: []const u8) void {
2354 self.framework_dirs.append(self.builder.dupe(dir_path)) catch unreachable;2332 self.framework_dirs.append(self.builder.dupe(dir_path)) catch unreachable;
2355 }2333 }
lib/std/builtin.zig+2-5
...@@ -184,9 +184,7 @@ pub const SourceLocation = struct {...@@ -184,9 +184,7 @@ pub const SourceLocation = struct {
184};184};
185185
186pub const TypeId = std.meta.Tag(Type);186pub const TypeId = std.meta.Tag(Type);
187187pub const TypeInfo = @compileError("deprecated; use Type");
188/// TODO deprecated, use `Type`
189pub const TypeInfo = Type;
190188
191/// This data structure is used by the Zig language code generation and189/// This data structure is used by the Zig language code generation and
192/// therefore must be kept in sync with the compiler implementation.190/// therefore must be kept in sync with the compiler implementation.
...@@ -359,8 +357,7 @@ pub const Type = union(enum) {...@@ -359,8 +357,7 @@ pub const Type = union(enum) {
359 decls: []const Declaration,357 decls: []const Declaration,
360 };358 };
361359
362 /// TODO deprecated use Fn.Param360 pub const FnArg = @compileError("deprecated; use Fn.Param");
363 pub const FnArg = Fn.Param;
364361
365 /// This data structure is used by the Zig language code generation and362 /// This data structure is used by the Zig language code generation and
366 /// therefore must be kept in sync with the compiler implementation.363 /// therefore must be kept in sync with the compiler implementation.
lib/std/crypto/25519/edwards25519.zig-1
...@@ -69,7 +69,6 @@ pub const Edwards25519 = struct {...@@ -69,7 +69,6 @@ pub const Edwards25519 = struct {
69 .is_base = true,69 .is_base = true,
70 };70 };
7171
72 pub const neutralElement = @compileError("deprecated: use identityElement instead");
73 pub const identityElement = Edwards25519{ .x = Fe.zero, .y = Fe.one, .z = Fe.one, .t = Fe.zero };72 pub const identityElement = Edwards25519{ .x = Fe.zero, .y = Fe.one, .z = Fe.one, .t = Fe.zero };
7473
75 /// Reject the neutral element.74 /// Reject the neutral element.
lib/std/fmt.zig-3
...@@ -1885,7 +1885,6 @@ test "parseUnsigned" {...@@ -1885,7 +1885,6 @@ test "parseUnsigned" {
1885}1885}
18861886
1887pub const parseFloat = @import("fmt/parse_float.zig").parseFloat;1887pub const parseFloat = @import("fmt/parse_float.zig").parseFloat;
1888pub const parseHexFloat = @compileError("deprecated; use `parseFloat`");
1889pub const ParseFloatError = @import("fmt/parse_float.zig").ParseFloatError;1888pub const ParseFloatError = @import("fmt/parse_float.zig").ParseFloatError;
18901889
1891test {1890test {
...@@ -1948,8 +1947,6 @@ pub fn allocPrint(allocator: mem.Allocator, comptime fmt: []const u8, args: anyt...@@ -1948,8 +1947,6 @@ pub fn allocPrint(allocator: mem.Allocator, comptime fmt: []const u8, args: anyt
1948 };1947 };
1949}1948}
19501949
1951pub const allocPrint0 = @compileError("deprecated; use allocPrintZ");
1952
1953pub fn allocPrintZ(allocator: mem.Allocator, comptime fmt: []const u8, args: anytype) AllocPrintError![:0]u8 {1950pub fn allocPrintZ(allocator: mem.Allocator, comptime fmt: []const u8, args: anytype) AllocPrintError![:0]u8 {
1954 const result = try allocPrint(allocator, fmt ++ "\x00", args);1951 const result = try allocPrint(allocator, fmt ++ "\x00", args);
1955 return result[0 .. result.len - 1 :0];1952 return result[0 .. result.len - 1 :0];
lib/std/hash_map.zig-6
...@@ -120,8 +120,6 @@ pub const StringIndexAdapter = struct {...@@ -120,8 +120,6 @@ pub const StringIndexAdapter = struct {
120 }120 }
121};121};
122122
123pub const DefaultMaxLoadPercentage = @compileError("deprecated; use `default_max_load_percentage`");
124
125pub const default_max_load_percentage = 80;123pub const default_max_load_percentage = 80;
126124
127/// This function issues a compile error with a helpful message if there125/// This function issues a compile error with a helpful message if there
...@@ -517,8 +515,6 @@ pub fn HashMap(...@@ -517,8 +515,6 @@ pub fn HashMap(
517 return self.unmanaged.getOrPutValueContext(self.allocator, key, value, self.ctx);515 return self.unmanaged.getOrPutValueContext(self.allocator, key, value, self.ctx);
518 }516 }
519517
520 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
521
522 /// Increases capacity, guaranteeing that insertions up until the518 /// Increases capacity, guaranteeing that insertions up until the
523 /// `expected_count` will not cause an allocation, and therefore cannot fail.519 /// `expected_count` will not cause an allocation, and therefore cannot fail.
524 pub fn ensureTotalCapacity(self: *Self, expected_count: Size) Allocator.Error!void {520 pub fn ensureTotalCapacity(self: *Self, expected_count: Size) Allocator.Error!void {
...@@ -900,8 +896,6 @@ pub fn HashMapUnmanaged(...@@ -900,8 +896,6 @@ pub fn HashMapUnmanaged(
900 return new_cap;896 return new_cap;
901 }897 }
902898
903 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
904
905 pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_size: Size) Allocator.Error!void {899 pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_size: Size) Allocator.Error!void {
906 if (@sizeOf(Context) != 0)900 if (@sizeOf(Context) != 0)
907 @compileError("Cannot infer context " ++ @typeName(Context) ++ ", call ensureTotalCapacityContext instead.");901 @compileError("Cannot infer context " ++ @typeName(Context) ++ ", call ensureTotalCapacityContext instead.");
lib/std/log.zig-12
...@@ -169,10 +169,6 @@ pub fn defaultLog(...@@ -169,10 +169,6 @@ pub fn defaultLog(
169/// provided here.169/// provided here.
170pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {170pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
171 return struct {171 return struct {
172 pub const emerg = @compileError("deprecated; use err instead of emerg");
173 pub const alert = @compileError("deprecated; use err instead of alert");
174 pub const crit = @compileError("deprecated; use err instead of crit");
175
176 /// Log an error message. This log level is intended to be used172 /// Log an error message. This log level is intended to be used
177 /// when something has gone wrong. This might be recoverable or might173 /// when something has gone wrong. This might be recoverable or might
178 /// be followed by the program exiting.174 /// be followed by the program exiting.
...@@ -194,8 +190,6 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -194,8 +190,6 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
194 log(.warn, scope, format, args);190 log(.warn, scope, format, args);
195 }191 }
196192
197 pub const notice = @compileError("deprecated; use info instead of notice");
198
199 /// Log an info message. This log level is intended to be used for193 /// Log an info message. This log level is intended to be used for
200 /// general messages about the state of the program.194 /// general messages about the state of the program.
201 pub fn info(195 pub fn info(
...@@ -219,10 +213,6 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -219,10 +213,6 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
219/// The default scoped logging namespace.213/// The default scoped logging namespace.
220pub const default = scoped(.default);214pub const default = scoped(.default);
221215
222pub const emerg = @compileError("deprecated; use err instead of emerg");
223pub const alert = @compileError("deprecated; use err instead of alert");
224pub const crit = @compileError("deprecated; use err instead of crit");
225
226/// Log an error message using the default scope. This log level is intended to216/// Log an error message using the default scope. This log level is intended to
227/// be used when something has gone wrong. This might be recoverable or might217/// be used when something has gone wrong. This might be recoverable or might
228/// be followed by the program exiting.218/// be followed by the program exiting.
...@@ -233,8 +223,6 @@ pub const err = default.err;...@@ -233,8 +223,6 @@ pub const err = default.err;
233/// the circumstances would be worth investigating.223/// the circumstances would be worth investigating.
234pub const warn = default.warn;224pub const warn = default.warn;
235225
236pub const notice = @compileError("deprecated; use info instead of notice");
237
238/// Log an info message using the default scope. This log level is intended to226/// Log an info message using the default scope. This log level is intended to
239/// be used for general messages about the state of the program.227/// be used for general messages about the state of the program.
240pub const info = default.info;228pub const info = default.info;
lib/std/math.zig-7
...@@ -170,13 +170,6 @@ pub fn approxEqRel(comptime T: type, x: T, y: T, tolerance: T) bool {...@@ -170,13 +170,6 @@ pub fn approxEqRel(comptime T: type, x: T, y: T, tolerance: T) bool {
170 return @fabs(x - y) <= max(@fabs(x), @fabs(y)) * tolerance;170 return @fabs(x - y) <= max(@fabs(x), @fabs(y)) * tolerance;
171}171}
172172
173pub fn approxEq(comptime T: type, x: T, y: T, tolerance: T) bool {
174 _ = x;
175 _ = y;
176 _ = tolerance;
177 @compileError("deprecated; use `approxEqAbs` or `approxEqRel`");
178}
179
180test "approxEqAbs and approxEqRel" {173test "approxEqAbs and approxEqRel" {
181 inline for ([_]type{ f16, f32, f64, f128 }) |T| {174 inline for ([_]type{ f16, f32, f64, f128 }) |T| {
182 const eps_value = comptime floatEps(T);175 const eps_value = comptime floatEps(T);
lib/std/math/complex.zig-2
...@@ -34,8 +34,6 @@ pub fn Complex(comptime T: type) type {...@@ -34,8 +34,6 @@ pub fn Complex(comptime T: type) type {
34 /// Imaginary part.34 /// Imaginary part.
35 im: T,35 im: T,
3636
37 pub const new = @compileError("deprecated; use init()");
38
39 /// Create a new Complex number from the given real and imaginary parts.37 /// Create a new Complex number from the given real and imaginary parts.
40 pub fn init(re: T, im: T) Self {38 pub fn init(re: T, im: T) Self {
41 return Self{39 return Self{
lib/std/mem.zig-10
...@@ -702,8 +702,6 @@ test "span" {...@@ -702,8 +702,6 @@ test "span" {
702 try testing.expectEqual(@as(?[:0]u16, null), span(@as(?[*:0]u16, null)));702 try testing.expectEqual(@as(?[:0]u16, null), span(@as(?[*:0]u16, null)));
703}703}
704704
705pub const spanZ = @compileError("deprecated; use use std.mem.span() or std.mem.sliceTo()");
706
707/// Helper for the return type of sliceTo()705/// Helper for the return type of sliceTo()
708fn SliceTo(comptime T: type, comptime end: meta.Elem(T)) type {706fn SliceTo(comptime T: type, comptime end: meta.Elem(T)) type {
709 switch (@typeInfo(T)) {707 switch (@typeInfo(T)) {
...@@ -957,8 +955,6 @@ test "len" {...@@ -957,8 +955,6 @@ test "len" {
957 }955 }
958}956}
959957
960pub const lenZ = @compileError("deprecated; use std.mem.len() or std.mem.sliceTo().len");
961
962pub fn indexOfSentinel(comptime Elem: type, comptime sentinel: Elem, ptr: [*:sentinel]const Elem) usize {958pub fn indexOfSentinel(comptime Elem: type, comptime sentinel: Elem, ptr: [*:sentinel]const Elem) usize {
963 var i: usize = 0;959 var i: usize = 0;
964 while (ptr[i] != sentinel) {960 while (ptr[i] != sentinel) {
...@@ -975,9 +971,6 @@ pub fn allEqual(comptime T: type, slice: []const T, scalar: T) bool {...@@ -975,9 +971,6 @@ pub fn allEqual(comptime T: type, slice: []const T, scalar: T) bool {
975 return true;971 return true;
976}972}
977973
978pub const dupe = @compileError("deprecated; use `Allocator.dupe`");
979pub const dupeZ = @compileError("deprecated; use `Allocator.dupeZ`");
980
981/// Remove values from the beginning of a slice.974/// Remove values from the beginning of a slice.
982pub fn trimLeft(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {975pub fn trimLeft(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {
983 var begin: usize = 0;976 var begin: usize = 0;
...@@ -1567,9 +1560,6 @@ test "writeIntBig and writeIntLittle" {...@@ -1567,9 +1560,6 @@ test "writeIntBig and writeIntLittle" {
1567 try testing.expect(eql(u8, buf2[0..], &[_]u8{ 0xfc, 0xff }));1560 try testing.expect(eql(u8, buf2[0..], &[_]u8{ 0xfc, 0xff }));
1568}1561}
15691562
1570/// TODO delete this deprecated declaration after 0.10.0 is released
1571pub const bswapAllFields = @compileError("bswapAllFields has been renamed to byteSwapAllFields");
1572
1573/// Swap the byte order of all the members of the fields of a struct1563/// Swap the byte order of all the members of the fields of a struct
1574/// (Changing their endianess)1564/// (Changing their endianess)
1575pub fn byteSwapAllFields(comptime S: type, ptr: *S) void {1565pub fn byteSwapAllFields(comptime S: type, ptr: *S) void {
lib/std/multi_array_list.zig-2
...@@ -334,8 +334,6 @@ pub fn MultiArrayList(comptime S: type) type {...@@ -334,8 +334,6 @@ pub fn MultiArrayList(comptime S: type) type {
334 self.len = new_len;334 self.len = new_len;
335 }335 }
336336
337 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
338
339 /// Modify the array so that it can hold at least `new_capacity` items.337 /// Modify the array so that it can hold at least `new_capacity` items.
340 /// Implements super-linear growth to achieve amortized O(1) append operations.338 /// Implements super-linear growth to achieve amortized O(1) append operations.
341 /// Invalidates pointers if additional memory is needed.339 /// Invalidates pointers if additional memory is needed.
lib/std/priority_dequeue.zig-2
...@@ -357,8 +357,6 @@ pub fn PriorityDequeue(comptime T: type, comptime Context: type, comptime compar...@@ -357,8 +357,6 @@ pub fn PriorityDequeue(comptime T: type, comptime Context: type, comptime compar
357 return queue;357 return queue;
358 }358 }
359359
360 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
361
362 /// Ensure that the dequeue can fit at least `new_capacity` items.360 /// Ensure that the dequeue can fit at least `new_capacity` items.
363 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) !void {361 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) !void {
364 var better_capacity = self.capacity();362 var better_capacity = self.capacity();
lib/std/priority_queue.zig-2
...@@ -185,8 +185,6 @@ pub fn PriorityQueue(comptime T: type, comptime Context: type, comptime compareF...@@ -185,8 +185,6 @@ pub fn PriorityQueue(comptime T: type, comptime Context: type, comptime compareF
185 return queue;185 return queue;
186 }186 }
187187
188 pub const ensureCapacity = @compileError("deprecated; use ensureUnusedCapacity or ensureTotalCapacity");
189
190 /// Ensure that the queue can fit at least `new_capacity` items.188 /// Ensure that the queue can fit at least `new_capacity` items.
191 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) !void {189 pub fn ensureTotalCapacity(self: *Self, new_capacity: usize) !void {
192 var better_capacity = self.capacity();190 var better_capacity = self.capacity();
src/Autodoc.zig+2-2
...@@ -531,7 +531,7 @@ const DocData = struct {...@@ -531,7 +531,7 @@ const DocData = struct {
531 Int: struct { name: []const u8 },531 Int: struct { name: []const u8 },
532 Float: struct { name: []const u8 },532 Float: struct { name: []const u8 },
533 Pointer: struct {533 Pointer: struct {
534 size: std.builtin.TypeInfo.Pointer.Size,534 size: std.builtin.Type.Pointer.Size,
535 child: Expr,535 child: Expr,
536 sentinel: ?Expr = null,536 sentinel: ?Expr = null,
537 @"align": ?Expr = null,537 @"align": ?Expr = null,
...@@ -641,7 +641,7 @@ const DocData = struct {...@@ -641,7 +641,7 @@ const DocData = struct {
641 const current_value = @field(self, case.name);641 const current_value = @field(self, case.name);
642 inline for (comptime std.meta.fields(case.field_type)) |f| {642 inline for (comptime std.meta.fields(case.field_type)) |f| {
643 try jsw.arrayElem();643 try jsw.arrayElem();
644 if (f.field_type == std.builtin.TypeInfo.Pointer.Size) {644 if (f.field_type == std.builtin.Type.Pointer.Size) {
645 try jsw.emitNumber(@enumToInt(@field(current_value, f.name)));645 try jsw.emitNumber(@enumToInt(@field(current_value, f.name)));
646 } else {646 } else {
647 try std.json.stringify(@field(current_value, f.name), opts, w);647 try std.json.stringify(@field(current_value, f.name), opts, w);