authorgravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2025-03-05 03:17:54+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-11 08:17:43+02:00
logeb375525366ba51c3f626cf9b27d97fc81e2c938
treebabf69fdb1cd163a81ecb4c23581a628bbf1f9ce
parentd83b95cbf4895027b1730ef6025df4fe01beba26

Remove numerous things deprecated during the 0.14 release cycle

Basically everything that has a direct replacement or no uses left. Notable omissions: - std.ArrayHashMap: Too much fallout, needs a separate cleanup. - std.debug.runtime_safety: Too much fallout. - std.heap.GeneralPurposeAllocator: Lots of references to it remain, not a simple find and replace as "debug allocator" is not equivalent to "general purpose allocator". - std.io.Reader: Is being reworked at the moment. - std.unicode.utf8Decode(): No replacement, needs a new API first. - Manifest backwards compat options: Removal would break test data used by TestFetchBuilder. - panic handler needs to be a namespace: Many tests still rely on it being a function, needs a separate cleanup.

62 files changed, 128 insertions(+), 642 deletions(-)

doc/langref/build_c.zig+2-1
......@@ -1,7 +1,8 @@
11const std = @import("std");
22
33pub fn build(b: *std.Build) void {
4 const lib = b.addSharedLibrary(.{
4 const lib = b.addLibrary(.{
5 .linkage = .dynamic,
56 .name = "mathtest",
67 .root_source_file = b.path("mathtest.zig"),
78 .version = .{ .major = 1, .minor = 0, .patch = 0 },
doc/langref/test_noreturn_from_exit.zig+1-1
......@@ -3,7 +3,7 @@ const builtin = @import("builtin");
33const native_arch = builtin.cpu.arch;
44const expect = std.testing.expect;
55
6const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86) .Stdcall else .C;
6const WINAPI: std.builtin.CallingConvention = if (native_arch == .x86) .{ .x86_stdcall = .{} } else .c;
77extern "kernel32" fn ExitProcess(exit_code: c_uint) callconv(WINAPI) noreturn;
88
99test "foo" {
lib/compiler/aro/aro/Parser.zig+1-1
......@@ -8259,7 +8259,7 @@ fn charLiteral(p: *Parser) Error!Result {
82598259 const slice = char_kind.contentSlice(p.tokSlice(p.tok_i));
82608260
82618261 var is_multichar = false;
8262 if (slice.len == 1 and std.ascii.isASCII(slice[0])) {
8262 if (slice.len == 1 and std.ascii.isAscii(slice[0])) {
82638263 // fast path: single unescaped ASCII char
82648264 val = slice[0];
82658265 } else {
lib/compiler/aro_translate_c.zig+1-1
......@@ -1820,7 +1820,7 @@ pub fn main() !void {
18201820 var tree = translate(gpa, &aro_comp, args) catch |err| switch (err) {
18211821 error.ParsingFailed, error.FatalError => renderErrorsAndExit(&aro_comp),
18221822 error.OutOfMemory => return error.OutOfMemory,
1823 error.StreamTooLong => std.zig.fatal("An input file was larger than 4GiB", .{}),
1823 error.StreamTooLong => std.process.fatal("An input file was larger than 4GiB", .{}),
18241824 };
18251825 defer tree.deinit(gpa);
18261826
lib/compiler/objcopy.zig+1-1
......@@ -7,7 +7,7 @@ const Allocator = std.mem.Allocator;
77const File = std.fs.File;
88const assert = std.debug.assert;
99
10const fatal = std.zig.fatal;
10const fatal = std.process.fatal;
1111const Server = std.zig.Server;
1212
1313pub fn main() !void {
lib/std/Build.zig+7-314
......@@ -692,6 +692,7 @@ pub fn addOptions(b: *Build) *Step.Options {
692692
693693pub const ExecutableOptions = struct {
694694 name: []const u8,
695 root_module: *Module,
695696 version: ?std.SemanticVersion = null,
696697 linkage: ?std.builtin.LinkMode = null,
697698 max_rss: usize = 0,
......@@ -704,58 +705,12 @@ pub const ExecutableOptions = struct {
704705 /// Can be set regardless of target. The `.manifest` file will be ignored
705706 /// if the target object format does not support embedded manifests.
706707 win32_manifest: ?LazyPath = null,
707
708 /// Prefer populating this field (using e.g. `createModule`) instead of populating
709 /// the following fields (`root_source_file` etc). In a future release, those fields
710 /// will be removed, and this field will become non-optional.
711 root_module: ?*Module = null,
712
713 /// Deprecated; prefer populating `root_module`.
714 root_source_file: ?LazyPath = null,
715 /// Deprecated; prefer populating `root_module`.
716 target: ?ResolvedTarget = null,
717 /// Deprecated; prefer populating `root_module`.
718 optimize: std.builtin.OptimizeMode = .Debug,
719 /// Deprecated; prefer populating `root_module`.
720 code_model: std.builtin.CodeModel = .default,
721 /// Deprecated; prefer populating `root_module`.
722 link_libc: ?bool = null,
723 /// Deprecated; prefer populating `root_module`.
724 single_threaded: ?bool = null,
725 /// Deprecated; prefer populating `root_module`.
726 pic: ?bool = null,
727 /// Deprecated; prefer populating `root_module`.
728 strip: ?bool = null,
729 /// Deprecated; prefer populating `root_module`.
730 unwind_tables: ?std.builtin.UnwindTables = null,
731 /// Deprecated; prefer populating `root_module`.
732 omit_frame_pointer: ?bool = null,
733 /// Deprecated; prefer populating `root_module`.
734 sanitize_thread: ?bool = null,
735 /// Deprecated; prefer populating `root_module`.
736 error_tracing: ?bool = null,
737708};
738709
739710pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {
740 if (options.root_module != null and options.target != null) {
741 @panic("`root_module` and `target` cannot both be populated");
742 }
743711 return .create(b, .{
744712 .name = options.name,
745 .root_module = options.root_module orelse b.createModule(.{
746 .root_source_file = options.root_source_file,
747 .target = options.target orelse @panic("`root_module` and `target` cannot both be null"),
748 .optimize = options.optimize,
749 .link_libc = options.link_libc,
750 .single_threaded = options.single_threaded,
751 .pic = options.pic,
752 .strip = options.strip,
753 .unwind_tables = options.unwind_tables,
754 .omit_frame_pointer = options.omit_frame_pointer,
755 .sanitize_thread = options.sanitize_thread,
756 .error_tracing = options.error_tracing,
757 .code_model = options.code_model,
758 }),
713 .root_module = options.root_module,
759714 .version = options.version,
760715 .kind = .exe,
761716 .linkage = options.linkage,
......@@ -769,62 +724,17 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {
769724
770725pub const ObjectOptions = struct {
771726 name: []const u8,
727 root_module: *Module,
772728 max_rss: usize = 0,
773729 use_llvm: ?bool = null,
774730 use_lld: ?bool = null,
775731 zig_lib_dir: ?LazyPath = null,
776
777 /// Prefer populating this field (using e.g. `createModule`) instead of populating
778 /// the following fields (`root_source_file` etc). In a future release, those fields
779 /// will be removed, and this field will become non-optional.
780 root_module: ?*Module = null,
781
782 /// Deprecated; prefer populating `root_module`.
783 root_source_file: ?LazyPath = null,
784 /// Deprecated; prefer populating `root_module`.
785 target: ?ResolvedTarget = null,
786 /// Deprecated; prefer populating `root_module`.
787 optimize: std.builtin.OptimizeMode = .Debug,
788 /// Deprecated; prefer populating `root_module`.
789 code_model: std.builtin.CodeModel = .default,
790 /// Deprecated; prefer populating `root_module`.
791 link_libc: ?bool = null,
792 /// Deprecated; prefer populating `root_module`.
793 single_threaded: ?bool = null,
794 /// Deprecated; prefer populating `root_module`.
795 pic: ?bool = null,
796 /// Deprecated; prefer populating `root_module`.
797 strip: ?bool = null,
798 /// Deprecated; prefer populating `root_module`.
799 unwind_tables: ?std.builtin.UnwindTables = null,
800 /// Deprecated; prefer populating `root_module`.
801 omit_frame_pointer: ?bool = null,
802 /// Deprecated; prefer populating `root_module`.
803 sanitize_thread: ?bool = null,
804 /// Deprecated; prefer populating `root_module`.
805 error_tracing: ?bool = null,
806732};
807733
808734pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {
809 if (options.root_module != null and options.target != null) {
810 @panic("`root_module` and `target` cannot both be populated");
811 }
812735 return .create(b, .{
813736 .name = options.name,
814 .root_module = options.root_module orelse b.createModule(.{
815 .root_source_file = options.root_source_file,
816 .target = options.target orelse @panic("`root_module` and `target` cannot both be null"),
817 .optimize = options.optimize,
818 .link_libc = options.link_libc,
819 .single_threaded = options.single_threaded,
820 .pic = options.pic,
821 .strip = options.strip,
822 .unwind_tables = options.unwind_tables,
823 .omit_frame_pointer = options.omit_frame_pointer,
824 .sanitize_thread = options.sanitize_thread,
825 .error_tracing = options.error_tracing,
826 .code_model = options.code_model,
827 }),
737 .root_module = options.root_module,
828738 .kind = .obj,
829739 .max_rss = options.max_rss,
830740 .use_llvm = options.use_llvm,
......@@ -833,153 +743,6 @@ pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {
833743 });
834744}
835745
836pub const SharedLibraryOptions = struct {
837 name: []const u8,
838 version: ?std.SemanticVersion = null,
839 max_rss: usize = 0,
840 use_llvm: ?bool = null,
841 use_lld: ?bool = null,
842 zig_lib_dir: ?LazyPath = null,
843 /// Embed a `.manifest` file in the compilation if the object format supports it.
844 /// https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-files-reference
845 /// Manifest files must have the extension `.manifest`.
846 /// Can be set regardless of target. The `.manifest` file will be ignored
847 /// if the target object format does not support embedded manifests.
848 win32_manifest: ?LazyPath = null,
849
850 /// Prefer populating this field (using e.g. `createModule`) instead of populating
851 /// the following fields (`root_source_file` etc). In a future release, those fields
852 /// will be removed, and this field will become non-optional.
853 root_module: ?*Module = null,
854
855 /// Deprecated; prefer populating `root_module`.
856 root_source_file: ?LazyPath = null,
857 /// Deprecated; prefer populating `root_module`.
858 target: ?ResolvedTarget = null,
859 /// Deprecated; prefer populating `root_module`.
860 optimize: std.builtin.OptimizeMode = .Debug,
861 /// Deprecated; prefer populating `root_module`.
862 code_model: std.builtin.CodeModel = .default,
863 /// Deprecated; prefer populating `root_module`.
864 link_libc: ?bool = null,
865 /// Deprecated; prefer populating `root_module`.
866 single_threaded: ?bool = null,
867 /// Deprecated; prefer populating `root_module`.
868 pic: ?bool = null,
869 /// Deprecated; prefer populating `root_module`.
870 strip: ?bool = null,
871 /// Deprecated; prefer populating `root_module`.
872 unwind_tables: ?std.builtin.UnwindTables = null,
873 /// Deprecated; prefer populating `root_module`.
874 omit_frame_pointer: ?bool = null,
875 /// Deprecated; prefer populating `root_module`.
876 sanitize_thread: ?bool = null,
877 /// Deprecated; prefer populating `root_module`.
878 error_tracing: ?bool = null,
879};
880
881/// Deprecated: use `b.addLibrary(.{ ..., .linkage = .dynamic })` instead.
882pub fn addSharedLibrary(b: *Build, options: SharedLibraryOptions) *Step.Compile {
883 if (options.root_module != null and options.target != null) {
884 @panic("`root_module` and `target` cannot both be populated");
885 }
886 return .create(b, .{
887 .name = options.name,
888 .root_module = options.root_module orelse b.createModule(.{
889 .target = options.target orelse @panic("`root_module` and `target` cannot both be null"),
890 .optimize = options.optimize,
891 .root_source_file = options.root_source_file,
892 .link_libc = options.link_libc,
893 .single_threaded = options.single_threaded,
894 .pic = options.pic,
895 .strip = options.strip,
896 .unwind_tables = options.unwind_tables,
897 .omit_frame_pointer = options.omit_frame_pointer,
898 .sanitize_thread = options.sanitize_thread,
899 .error_tracing = options.error_tracing,
900 .code_model = options.code_model,
901 }),
902 .kind = .lib,
903 .linkage = .dynamic,
904 .version = options.version,
905 .max_rss = options.max_rss,
906 .use_llvm = options.use_llvm,
907 .use_lld = options.use_lld,
908 .zig_lib_dir = options.zig_lib_dir,
909 .win32_manifest = options.win32_manifest,
910 });
911}
912
913pub const StaticLibraryOptions = struct {
914 name: []const u8,
915 version: ?std.SemanticVersion = null,
916 max_rss: usize = 0,
917 use_llvm: ?bool = null,
918 use_lld: ?bool = null,
919 zig_lib_dir: ?LazyPath = null,
920
921 /// Prefer populating this field (using e.g. `createModule`) instead of populating
922 /// the following fields (`root_source_file` etc). In a future release, those fields
923 /// will be removed, and this field will become non-optional.
924 root_module: ?*Module = null,
925
926 /// Deprecated; prefer populating `root_module`.
927 root_source_file: ?LazyPath = null,
928 /// Deprecated; prefer populating `root_module`.
929 target: ?ResolvedTarget = null,
930 /// Deprecated; prefer populating `root_module`.
931 optimize: std.builtin.OptimizeMode = .Debug,
932 /// Deprecated; prefer populating `root_module`.
933 code_model: std.builtin.CodeModel = .default,
934 /// Deprecated; prefer populating `root_module`.
935 link_libc: ?bool = null,
936 /// Deprecated; prefer populating `root_module`.
937 single_threaded: ?bool = null,
938 /// Deprecated; prefer populating `root_module`.
939 pic: ?bool = null,
940 /// Deprecated; prefer populating `root_module`.
941 strip: ?bool = null,
942 /// Deprecated; prefer populating `root_module`.
943 unwind_tables: ?std.builtin.UnwindTables = null,
944 /// Deprecated; prefer populating `root_module`.
945 omit_frame_pointer: ?bool = null,
946 /// Deprecated; prefer populating `root_module`.
947 sanitize_thread: ?bool = null,
948 /// Deprecated; prefer populating `root_module`.
949 error_tracing: ?bool = null,
950};
951
952/// Deprecated: use `b.addLibrary(.{ ..., .linkage = .static })` instead.
953pub fn addStaticLibrary(b: *Build, options: StaticLibraryOptions) *Step.Compile {
954 if (options.root_module != null and options.target != null) {
955 @panic("`root_module` and `target` cannot both be populated");
956 }
957 return .create(b, .{
958 .name = options.name,
959 .root_module = options.root_module orelse b.createModule(.{
960 .target = options.target orelse @panic("`root_module` and `target` cannot both be null"),
961 .optimize = options.optimize,
962 .root_source_file = options.root_source_file,
963 .link_libc = options.link_libc,
964 .single_threaded = options.single_threaded,
965 .pic = options.pic,
966 .strip = options.strip,
967 .unwind_tables = options.unwind_tables,
968 .omit_frame_pointer = options.omit_frame_pointer,
969 .sanitize_thread = options.sanitize_thread,
970 .error_tracing = options.error_tracing,
971 .code_model = options.code_model,
972 }),
973 .kind = .lib,
974 .linkage = .static,
975 .version = options.version,
976 .max_rss = options.max_rss,
977 .use_llvm = options.use_llvm,
978 .use_lld = options.use_lld,
979 .zig_lib_dir = options.zig_lib_dir,
980 });
981}
982
983746pub const LibraryOptions = struct {
984747 linkage: std.builtin.LinkMode = .static,
985748 name: []const u8,
......@@ -1014,9 +777,8 @@ pub fn addLibrary(b: *Build, options: LibraryOptions) *Step.Compile {
1014777
1015778pub const TestOptions = struct {
1016779 name: []const u8 = "test",
780 root_module: *Module,
1017781 max_rss: usize = 0,
1018 /// Deprecated; use `.filters = &.{filter}` instead of `.filter = filter`.
1019 filter: ?[]const u8 = null,
1020782 filters: []const []const u8 = &.{},
1021783 test_runner: ?Step.Compile.TestRunner = null,
1022784 use_llvm: ?bool = null,
......@@ -1026,38 +788,6 @@ pub const TestOptions = struct {
1026788 /// The object must be linked separately.
1027789 /// Usually used in conjunction with a custom `test_runner`.
1028790 emit_object: bool = false,
1029
1030 /// Prefer populating this field (using e.g. `createModule`) instead of populating
1031 /// the following fields (`root_source_file` etc). In a future release, those fields
1032 /// will be removed, and this field will become non-optional.
1033 root_module: ?*Module = null,
1034
1035 /// Deprecated; prefer populating `root_module`.
1036 root_source_file: ?LazyPath = null,
1037 /// Deprecated; prefer populating `root_module`.
1038 target: ?ResolvedTarget = null,
1039 /// Deprecated; prefer populating `root_module`.
1040 optimize: std.builtin.OptimizeMode = .Debug,
1041 /// Deprecated; prefer populating `root_module`.
1042 version: ?std.SemanticVersion = null,
1043 /// Deprecated; prefer populating `root_module`.
1044 link_libc: ?bool = null,
1045 /// Deprecated; prefer populating `root_module`.
1046 link_libcpp: ?bool = null,
1047 /// Deprecated; prefer populating `root_module`.
1048 single_threaded: ?bool = null,
1049 /// Deprecated; prefer populating `root_module`.
1050 pic: ?bool = null,
1051 /// Deprecated; prefer populating `root_module`.
1052 strip: ?bool = null,
1053 /// Deprecated; prefer populating `root_module`.
1054 unwind_tables: ?std.builtin.UnwindTables = null,
1055 /// Deprecated; prefer populating `root_module`.
1056 omit_frame_pointer: ?bool = null,
1057 /// Deprecated; prefer populating `root_module`.
1058 sanitize_thread: ?bool = null,
1059 /// Deprecated; prefer populating `root_module`.
1060 error_tracing: ?bool = null,
1061791};
1062792
1063793/// Creates an executable containing unit tests.
......@@ -1069,33 +799,12 @@ pub const TestOptions = struct {
1069799/// two steps are separated because they are independently configured and
1070800/// cached.
1071801pub fn addTest(b: *Build, options: TestOptions) *Step.Compile {
1072 if (options.root_module != null and options.root_source_file != null) {
1073 @panic("`root_module` and `root_source_file` cannot both be populated");
1074 }
1075802 return .create(b, .{
1076803 .name = options.name,
1077804 .kind = if (options.emit_object) .test_obj else .@"test",
1078 .root_module = options.root_module orelse b.createModule(.{
1079 .root_source_file = options.root_source_file orelse @panic("`root_module` and `root_source_file` cannot both be null"),
1080 .target = options.target orelse b.graph.host,
1081 .optimize = options.optimize,
1082 .link_libc = options.link_libc,
1083 .link_libcpp = options.link_libcpp,
1084 .single_threaded = options.single_threaded,
1085 .pic = options.pic,
1086 .strip = options.strip,
1087 .unwind_tables = options.unwind_tables,
1088 .omit_frame_pointer = options.omit_frame_pointer,
1089 .sanitize_thread = options.sanitize_thread,
1090 .error_tracing = options.error_tracing,
1091 }),
805 .root_module = options.root_module,
1092806 .max_rss = options.max_rss,
1093 .filters = if (options.filter != null and options.filters.len > 0) filters: {
1094 const filters = b.allocator.alloc([]const u8, 1 + options.filters.len) catch @panic("OOM");
1095 filters[0] = b.dupe(options.filter.?);
1096 for (filters[1..], options.filters) |*dest, source| dest.* = b.dupe(source);
1097 break :filters filters;
1098 } else b.dupeStrings(if (options.filter) |filter| &.{filter} else options.filters),
807 .filters = b.dupeStrings(options.filters),
1099808 .test_runner = options.test_runner,
1100809 .use_llvm = options.use_llvm,
1101810 .use_lld = options.use_lld,
......@@ -1114,22 +823,6 @@ pub const AssemblyOptions = struct {
1114823 zig_lib_dir: ?LazyPath = null,
1115824};
1116825
1117/// Deprecated; prefer using `addObject` where the `root_module` has an empty
1118/// `root_source_file` and contains an assembly file via `Module.addAssemblyFile`.
1119pub fn addAssembly(b: *Build, options: AssemblyOptions) *Step.Compile {
1120 const root_module = b.createModule(.{
1121 .target = options.target,
1122 .optimize = options.optimize,
1123 });
1124 root_module.addAssemblyFile(options.source_file);
1125 return b.addObject(.{
1126 .name = options.name,
1127 .max_rss = options.max_rss,
1128 .zig_lib_dir = options.zig_lib_dir,
1129 .root_module = root_module,
1130 });
1131}
1132
1133826/// This function creates a module and adds it to the package's module set, making
1134827/// it available to other packages which depend on this one.
1135828/// `createModule` can be used instead to create a private module.
lib/std/Build/Cache.zig+4-4
......@@ -1326,7 +1326,7 @@ test "cache file and then recall it" {
13261326 // Wait for file timestamps to tick
13271327 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);
13281328 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {
1329 std.time.sleep(1);
1329 std.Thread.sleep(1);
13301330 }
13311331
13321332 var digest1: HexDigest = undefined;
......@@ -1389,7 +1389,7 @@ test "check that changing a file makes cache fail" {
13891389 // Wait for file timestamps to tick
13901390 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);
13911391 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {
1392 std.time.sleep(1);
1392 std.Thread.sleep(1);
13931393 }
13941394
13951395 var digest1: HexDigest = undefined;
......@@ -1501,7 +1501,7 @@ test "Manifest with files added after initial hash work" {
15011501 // Wait for file timestamps to tick
15021502 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);
15031503 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {
1504 std.time.sleep(1);
1504 std.Thread.sleep(1);
15051505 }
15061506
15071507 var digest1: HexDigest = undefined;
......@@ -1551,7 +1551,7 @@ test "Manifest with files added after initial hash work" {
15511551 // Wait for file timestamps to tick
15521552 const initial_time2 = try testGetCurrentFileTimestamp(tmp.dir);
15531553 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time2) {
1554 std.time.sleep(1);
1554 std.Thread.sleep(1);
15551555 }
15561556
15571557 {
lib/std/Build/Step/ConfigHeader.zig+3-6
......@@ -8,9 +8,6 @@ pub const Style = union(enum) {
88 /// A configure format supported by autotools that uses `#undef foo` to
99 /// mark lines that can be substituted with different values.
1010 autoconf_undef: std.Build.LazyPath,
11 /// Deprecated. Renamed to `autoconf_undef`.
12 /// To be removed after 0.14.0 is tagged.
13 autoconf: std.Build.LazyPath,
1411 /// A configure format supported by autotools that uses `@FOO@` output variables.
1512 autoconf_at: std.Build.LazyPath,
1613 /// The configure format supported by CMake. It uses `@FOO@`, `${}` and
......@@ -23,7 +20,7 @@ pub const Style = union(enum) {
2320
2421 pub fn getPath(style: Style) ?std.Build.LazyPath {
2522 switch (style) {
26 .autoconf_undef, .autoconf, .autoconf_at, .cmake => |s| return s,
23 .autoconf_undef, .autoconf_at, .cmake => |s| return s,
2724 .blank, .nasm => return null,
2825 }
2926 }
......@@ -205,7 +202,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
205202 const asm_generated_line = "; " ++ header_text ++ "\n";
206203
207204 switch (config_header.style) {
208 .autoconf_undef, .autoconf, .autoconf_at => |file_source| {
205 .autoconf_undef, .autoconf_at => |file_source| {
209206 try bw.writeAll(c_generated_line);
210207 const src_path = file_source.getPath2(b, step);
211208 const contents = std.fs.cwd().readFileAlloc(arena, src_path, config_header.max_bytes) catch |err| {
......@@ -214,7 +211,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
214211 });
215212 };
216213 switch (config_header.style) {
217 .autoconf_undef, .autoconf => try render_autoconf_undef(step, contents, bw, config_header.values, src_path),
214 .autoconf_undef => try render_autoconf_undef(step, contents, bw, config_header.values, src_path),
218215 .autoconf_at => try render_autoconf_at(step, contents, &aw, config_header.values, src_path),
219216 else => unreachable,
220217 }
lib/std/Build/Step/TranslateC.zig-13
......@@ -63,19 +63,6 @@ pub fn getOutput(translate_c: *TranslateC) std.Build.LazyPath {
6363 return .{ .generated = .{ .file = &translate_c.output_file } };
6464}
6565
66/// Deprecated: use `createModule` or `addModule` with `std.Build.addExecutable` instead.
67/// Creates a step to build an executable from the translated source.
68pub fn addExecutable(translate_c: *TranslateC, options: AddExecutableOptions) *Step.Compile {
69 return translate_c.step.owner.addExecutable(.{
70 .root_source_file = translate_c.getOutput(),
71 .name = options.name orelse "translated_c",
72 .version = options.version,
73 .target = options.target orelse translate_c.target,
74 .optimize = options.optimize orelse translate_c.optimize,
75 .linkage = options.linkage,
76 });
77}
78
7966/// Creates a module from the translated source and adds it to the package's
8067/// module set making it available to other packages which depend on this one.
8168/// `createModule` can be used instead to create a private module.
lib/std/Build/Watch.zig+1-1
......@@ -4,7 +4,7 @@ const Watch = @This();
44const Step = std.Build.Step;
55const Allocator = std.mem.Allocator;
66const assert = std.debug.assert;
7const fatal = std.zig.fatal;
7const fatal = std.process.fatal;
88
99dir_table: DirTable,
1010os: Os,
lib/std/Thread/Condition.zig+3-3
......@@ -130,7 +130,7 @@ const SingleThreadedImpl = struct {
130130 unreachable; // deadlock detected
131131 };
132132
133 std.time.sleep(timeout_ns);
133 std.Thread.sleep(timeout_ns);
134134 return error.Timeout;
135135 }
136136
......@@ -348,7 +348,7 @@ test "wait and signal" {
348348 }
349349
350350 while (true) {
351 std.time.sleep(100 * std.time.ns_per_ms);
351 std.Thread.sleep(100 * std.time.ns_per_ms);
352352
353353 multi_wait.mutex.lock();
354354 defer multi_wait.mutex.unlock();
......@@ -405,7 +405,7 @@ test signal {
405405 }
406406
407407 while (true) {
408 std.time.sleep(10 * std.time.ns_per_ms);
408 std.Thread.sleep(10 * std.time.ns_per_ms);
409409
410410 signal_test.mutex.lock();
411411 defer signal_test.mutex.unlock();
lib/std/Thread/Futex.zig+1-1
......@@ -116,7 +116,7 @@ const SingleThreadedImpl = struct {
116116 unreachable; // deadlock detected
117117 };
118118
119 std.time.sleep(delay);
119 std.Thread.sleep(delay);
120120 return error.Timeout;
121121 }
122122
lib/std/Thread/ResetEvent.zig+1-1
......@@ -74,7 +74,7 @@ const SingleThreadedImpl = struct {
7474 unreachable; // deadlock detected
7575 };
7676
77 std.time.sleep(timeout_ns);
77 std.Thread.sleep(timeout_ns);
7878 return error.Timeout;
7979 }
8080
lib/std/ascii.zig-3
......@@ -181,9 +181,6 @@ pub fn isAscii(c: u8) bool {
181181 return c < 128;
182182}
183183
184/// Deprecated: use `isAscii`
185pub const isASCII = isAscii;
186
187184/// Uppercases the character and returns it as-is if already uppercase or not a letter.
188185pub fn toUpper(c: u8) u8 {
189186 const mask = @as(u8, @intFromBool(isLower(c))) << 5;
lib/std/atomic.zig-2
......@@ -10,8 +10,6 @@ pub fn Value(comptime T: type) type {
1010 return .{ .raw = value };
1111 }
1212
13 pub const fence = @compileError("@fence is deprecated, use other atomics to establish ordering");
14
1513 pub inline fn load(self: *const Self, comptime order: AtomicOrder) T {
1614 return @atomicLoad(T, &self.raw, order);
1715 }
lib/std/builtin.zig-55
......@@ -154,9 +154,6 @@ pub const OptimizeMode = enum {
154154 ReleaseSmall,
155155};
156156
157/// Deprecated; use OptimizeMode.
158pub const Mode = OptimizeMode;
159
160157/// The calling convention of a function defines how arguments and return values are passed, as well
161158/// as any other requirements which callers and callees must respect, such as register preservation
162159/// and stack alignment.
......@@ -185,51 +182,6 @@ pub const CallingConvention = union(enum(u8)) {
185182 else => unreachable,
186183 };
187184
188 /// Deprecated; use `.auto`.
189 pub const Unspecified: CallingConvention = .auto;
190 /// Deprecated; use `.c`.
191 pub const C: CallingConvention = .c;
192 /// Deprecated; use `.naked`.
193 pub const Naked: CallingConvention = .naked;
194 /// Deprecated; use `.@"inline"`.
195 pub const Inline: CallingConvention = .@"inline";
196 /// Deprecated; use `.x86_64_interrupt`, `.x86_interrupt`, or `.avr_interrupt`.
197 pub const Interrupt: CallingConvention = switch (builtin.target.cpu.arch) {
198 .x86_64 => .{ .x86_64_interrupt = .{} },
199 .x86 => .{ .x86_interrupt = .{} },
200 .avr => .avr_interrupt,
201 else => unreachable,
202 };
203 /// Deprecated; use `.avr_signal`.
204 pub const Signal: CallingConvention = .avr_signal;
205 /// Deprecated; use `.x86_stdcall`.
206 pub const Stdcall: CallingConvention = .{ .x86_stdcall = .{} };
207 /// Deprecated; use `.x86_fastcall`.
208 pub const Fastcall: CallingConvention = .{ .x86_fastcall = .{} };
209 /// Deprecated; use `.x86_64_vectorcall`, `.x86_vectorcall`, or `aarch64_vfabi`.
210 pub const Vectorcall: CallingConvention = switch (builtin.target.cpu.arch) {
211 .x86_64 => .{ .x86_64_vectorcall = .{} },
212 .x86 => .{ .x86_vectorcall = .{} },
213 .aarch64, .aarch64_be => .{ .aarch64_vfabi = .{} },
214 else => unreachable,
215 };
216 /// Deprecated; use `.x86_thiscall`.
217 pub const Thiscall: CallingConvention = .{ .x86_thiscall = .{} };
218 /// Deprecated; use `.arm_aapcs`.
219 pub const AAPCS: CallingConvention = .{ .arm_aapcs = .{} };
220 /// Deprecated; use `.arm_aapcs_vfp`.
221 pub const AAPCSVFP: CallingConvention = .{ .arm_aapcs_vfp = .{} };
222 /// Deprecated; use `.x86_64_sysv`.
223 pub const SysV: CallingConvention = .{ .x86_64_sysv = .{} };
224 /// Deprecated; use `.x86_64_win`.
225 pub const Win64: CallingConvention = .{ .x86_64_win = .{} };
226 /// Deprecated; use `.kernel`.
227 pub const Kernel: CallingConvention = .kernel;
228 /// Deprecated; use `.spirv_fragment`.
229 pub const Fragment: CallingConvention = .spirv_fragment;
230 /// Deprecated; use `.spirv_vertex`.
231 pub const Vertex: CallingConvention = .spirv_vertex;
232
233185 /// The default Zig calling convention when neither `export` nor `inline` is specified.
234186 /// This calling convention makes no guarantees about stack alignment, registers, etc.
235187 /// It can only be used within this Zig compilation unit.
......@@ -1117,10 +1069,6 @@ pub const TestFn = struct {
11171069 func: *const fn () anyerror!void,
11181070};
11191071
1120/// Deprecated, use the `Panic` namespace instead.
1121/// To be deleted after 0.14.0 is released.
1122pub const PanicFn = fn ([]const u8, ?*StackTrace, ?usize) noreturn;
1123
11241072/// This namespace is used by the Zig compiler to emit various kinds of safety
11251073/// panics. These can be overridden by making a public `panic` namespace in the
11261074/// root source file.
......@@ -1136,9 +1084,6 @@ pub const panic: type = p: {
11361084 }
11371085 break :p root.panic;
11381086 }
1139 if (@hasDecl(root, "Panic")) {
1140 break :p root.Panic; // Deprecated; use `panic` instead.
1141 }
11421087 break :p switch (builtin.zig_backend) {
11431088 .stage2_powerpc,
11441089 .stage2_riscv64,
lib/std/crypto.zig-18
......@@ -101,7 +101,6 @@ pub const dh = struct {
101101pub const kem = struct {
102102 pub const kyber_d00 = @import("crypto/ml_kem.zig").d00;
103103 pub const ml_kem = @import("crypto/ml_kem.zig").nist;
104 pub const ml_kem_01 = @compileError("deprecated: final version of the specification has been published, use ml_kem instead");
105104};
106105
107106/// Elliptic-curve arithmetic.
......@@ -400,20 +399,3 @@ test secureZero {
400399
401400 try std.testing.expectEqualSlices(u8, &a, &b);
402401}
403
404/// Deprecated in favor of `std.crypto`. To be removed after Zig 0.14.0 is released.
405///
406/// As a reminder, never use "utils" in a namespace (in any programming language).
407/// https://ziglang.org/documentation/0.13.0/#Avoid-Redundancy-in-Names
408pub const utils = struct {
409 /// Deprecated in favor of `std.crypto.secureZero`.
410 pub const secureZero = std.crypto.secureZero;
411 /// Deprecated in favor of `std.crypto.timing_safe.eql`.
412 pub const timingSafeEql = timing_safe.eql;
413 /// Deprecated in favor of `std.crypto.timing_safe.compare`.
414 pub const timingSafeCompare = timing_safe.compare;
415 /// Deprecated in favor of `std.crypto.timing_safe.add`.
416 pub const timingSafeAdd = timing_safe.add;
417 /// Deprecated in favor of `std.crypto.timing_safe.sub`.
418 pub const timingSafeSub = timing_safe.sub;
419};
lib/std/crypto/timing_safe.zig+1-1
......@@ -265,7 +265,7 @@ test classify {
265265
266266 // Comparing secret data must be done in constant time. The result
267267 // is going to be considered as secret as well.
268 var res = std.crypto.utils.timingSafeEql([32]u8, out, secret);
268 var res = std.crypto.timing_safe.eql([32]u8, out, secret);
269269
270270 // If we want to make a conditional jump based on a secret,
271271 // it has to be declassified.
lib/std/debug.zig-4
......@@ -227,10 +227,6 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {
227227 nosuspend bw.print(fmt, args) catch return;
228228}
229229
230pub fn getStderrMutex() *std.Thread.Mutex {
231 @compileError("deprecated. call std.debug.lockStdErr() and std.debug.unlockStdErr() instead which will integrate properly with std.Progress");
232}
233
234230/// TODO multithreaded awareness
235231var self_debug_info: ?SelfInfo = null;
236232
lib/std/fs.zig-10
......@@ -35,8 +35,6 @@ pub const realpathW = posix.realpathW;
3535pub const getAppDataDir = @import("fs/get_app_data_dir.zig").getAppDataDir;
3636pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirError;
3737
38pub const MAX_PATH_BYTES = @compileError("deprecated; renamed to max_path_bytes");
39
4038/// The maximum length of a file path that the operating system will accept.
4139///
4240/// Paths, including those returned from file system operations, may be longer
......@@ -90,9 +88,6 @@ pub const max_name_bytes = switch (native_os) {
9088 @compileError("NAME_MAX not implemented for " ++ @tagName(native_os)),
9189};
9290
93/// Deprecated: use `max_name_bytes`
94pub const MAX_NAME_BYTES = max_name_bytes;
95
9691pub const base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".*;
9792
9893/// Base64 encoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.
......@@ -101,11 +96,6 @@ pub const base64_encoder = base64.Base64Encoder.init(base64_alphabet, null);
10196/// Base64 decoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.
10297pub const base64_decoder = base64.Base64Decoder.init(base64_alphabet, null);
10398
104/// Deprecated. Use `cwd().atomicSymLink()` instead.
105pub fn atomicSymLink(_: Allocator, existing_path: []const u8, new_path: []const u8) !void {
106 try cwd().atomicSymLink(existing_path, new_path, .{});
107}
108
10999/// Same as `Dir.updateFile`, except asserts that both `source_path` and `dest_path`
110100/// are absolute. See `Dir.updateFile` for a function that operates on both
111101/// absolute and relative paths.
lib/std/fs/Dir.zig-5
......@@ -1402,9 +1402,6 @@ pub fn setAsCwd(self: Dir) !void {
14021402 try posix.fchdir(self.fd);
14031403}
14041404
1405/// Deprecated: use `OpenOptions`
1406pub const OpenDirOptions = OpenOptions;
1407
14081405pub const OpenOptions = struct {
14091406 /// `true` means the opened directory can be used as the `Dir` parameter
14101407 /// for functions which operate based on an open directory handle. When `false`,
......@@ -2459,8 +2456,6 @@ pub fn writeFile(self: Dir, options: WriteFileOptions) WriteFileError!void {
24592456 try file.writeAll(options.data);
24602457}
24612458
2462pub const writeFile2 = @compileError("deprecated; renamed to writeFile");
2463
24642459pub const AccessError = posix.AccessError;
24652460
24662461/// Test accessing `sub_path`.
lib/std/hash.zig+1-2
......@@ -81,9 +81,8 @@ fn uint16(input: u16) u16 {
8181 return x;
8282}
8383
84/// DEPRECATED: use std.hash.int()
8584/// Source: https://github.com/skeeto/hash-prospector
86pub fn uint32(input: u32) u32 {
85fn uint32(input: u32) u32 {
8786 var x: u32 = input;
8887 x = (x ^ (x >> 17)) *% 0xed5ad4bb;
8988 x = (x ^ (x >> 11)) *% 0xac4c1b51;
lib/std/hash/crc/impl.zig-10
......@@ -100,13 +100,3 @@ pub fn Crc(comptime W: type, comptime algorithm: Algorithm(W)) type {
100100 }
101101 };
102102}
103
104pub const Polynomial = enum(u32) {
105 IEEE = @compileError("use Crc with algorithm .Crc32IsoHdlc"),
106 Castagnoli = @compileError("use Crc with algorithm .Crc32Iscsi"),
107 Koopman = @compileError("use Crc with algorithm .Crc32Koopman"),
108 _,
109};
110
111pub const Crc32WithPoly = @compileError("use Crc instead");
112pub const Crc32SmallWithPoly = @compileError("use Crc instead");
lib/std/leb128.zig-12
......@@ -33,9 +33,6 @@ pub fn readUleb128(comptime T: type, reader: anytype) !T {
3333 return @as(T, @truncate(value));
3434}
3535
36/// Deprecated: use `readUleb128`
37pub const readULEB128 = readUleb128;
38
3936/// Write a single unsigned integer as unsigned LEB128 to the given writer.
4037pub fn writeUleb128(writer: anytype, arg: anytype) !void {
4138 const Arg = @TypeOf(arg);
......@@ -58,9 +55,6 @@ pub fn writeUleb128(writer: anytype, arg: anytype) !void {
5855 }
5956}
6057
61/// Deprecated: use `writeUleb128`
62pub const writeULEB128 = writeUleb128;
63
6458/// Read a single signed LEB128 value from the given reader as type T,
6559/// or error.Overflow if the value cannot fit.
6660pub fn readIleb128(comptime T: type, reader: anytype) !T {
......@@ -119,9 +113,6 @@ pub fn readIleb128(comptime T: type, reader: anytype) !T {
119113 return @as(T, @truncate(result));
120114}
121115
122/// Deprecated: use `readIleb128`
123pub const readILEB128 = readIleb128;
124
125116/// Write a single signed integer as signed LEB128 to the given writer.
126117pub fn writeIleb128(writer: anytype, arg: anytype) !void {
127118 const Arg = @TypeOf(arg);
......@@ -176,9 +167,6 @@ pub fn writeUnsignedExtended(slice: []u8, arg: anytype) void {
176167 slice[slice.len - 1] = @as(u7, @intCast(value));
177168}
178169
179/// Deprecated: use `writeIleb128`
180pub const writeILEB128 = writeIleb128;
181
182170test writeUnsignedFixed {
183171 {
184172 var buf: [4]u8 = undefined;
lib/std/math/big/int.zig-6
......@@ -2222,9 +2222,6 @@ pub const Const = struct {
22222222 TargetTooSmall,
22232223 };
22242224
2225 /// Deprecated; use `toInt`.
2226 pub const to = toInt;
2227
22282225 /// Convert `self` to `Int`.
22292226 ///
22302227 /// Returns an error if self cannot be narrowed into the requested type without truncation.
......@@ -2855,9 +2852,6 @@ pub const Managed = struct {
28552852
28562853 pub const ConvertError = Const.ConvertError;
28572854
2858 /// Deprecated; use `toInt`.
2859 pub const to = toInt;
2860
28612855 /// Convert `self` to `Int`.
28622856 ///
28632857 /// Returns an error if self cannot be narrowed into the requested type without truncation.
lib/std/math/big/int_test.zig+1-1
......@@ -688,7 +688,7 @@ test "string set base 36" {
688688 defer a.deinit();
689689
690690 try a.setString(36, "fifvthrv1mzt79ez9");
691 try testing.expectEqual(123456789123456789123456789, try a.to(u128));
691 try testing.expectEqual(123456789123456789123456789, try a.toInt(u128));
692692}
693693
694694test "string set bad char error" {
lib/std/mem.zig-6
......@@ -2258,8 +2258,6 @@ test byteSwapAllFields {
22582258 }, k);
22592259}
22602260
2261pub const tokenize = @compileError("deprecated; use tokenizeAny, tokenizeSequence, or tokenizeScalar");
2262
22632261/// Returns an iterator that iterates over the slices of `buffer` that are not
22642262/// any of the items in `delimiters`.
22652263///
......@@ -2458,8 +2456,6 @@ test "tokenize (reset)" {
24582456 }
24592457}
24602458
2461pub const split = @compileError("deprecated; use splitSequence, splitAny, or splitScalar");
2462
24632459/// Returns an iterator that iterates over the slices of `buffer` that
24642460/// are separated by the byte sequence in `delimiter`.
24652461///
......@@ -2659,8 +2655,6 @@ test "split (reset)" {
26592655 }
26602656}
26612657
2662pub const splitBackwards = @compileError("deprecated; use splitBackwardsSequence, splitBackwardsAny, or splitBackwardsScalar");
2663
26642658/// Returns an iterator that iterates backwards over the slices of `buffer` that
26652659/// are separated by the sequence in `delimiter`.
26662660///
lib/std/meta.zig-23
......@@ -418,29 +418,6 @@ test fieldInfo {
418418 try testing.expect(comptime uf.type == u8);
419419}
420420
421/// Deprecated: use @FieldType
422pub fn FieldType(comptime T: type, comptime field: FieldEnum(T)) type {
423 return @FieldType(T, @tagName(field));
424}
425
426test FieldType {
427 const S = struct {
428 a: u8,
429 b: u16,
430 };
431
432 const U = union {
433 c: u32,
434 d: *const u8,
435 };
436
437 try testing.expect(FieldType(S, .a) == u8);
438 try testing.expect(FieldType(S, .b) == u16);
439
440 try testing.expect(FieldType(U, .c) == u32);
441 try testing.expect(FieldType(U, .d) == *const u8);
442}
443
444421pub fn fieldNames(comptime T: type) *const [fields(T).len][:0]const u8 {
445422 return comptime blk: {
446423 const fieldInfos = fields(T);
lib/std/net.zig+1-3
......@@ -214,8 +214,6 @@ pub const Address = extern union {
214214 /// Sets SO_REUSEADDR and SO_REUSEPORT on POSIX.
215215 /// Sets SO_REUSEADDR on Windows, which is roughly equivalent.
216216 reuse_address: bool = false,
217 /// Deprecated. Does the same thing as reuse_address.
218 reuse_port: bool = false,
219217 force_nonblocking: bool = false,
220218 };
221219
......@@ -232,7 +230,7 @@ pub const Address = extern union {
232230 };
233231 errdefer s.stream.close();
234232
235 if (options.reuse_address or options.reuse_port) {
233 if (options.reuse_address) {
236234 try posix.setsockopt(
237235 sockfd,
238236 posix.SOL.SOCKET,
lib/std/net/test.zig+4-4
......@@ -232,10 +232,10 @@ test "listen on an in use port" {
232232
233233 const localhost = try net.Address.parseIp("127.0.0.1", 0);
234234
235 var server1 = try localhost.listen(.{ .reuse_port = true });
235 var server1 = try localhost.listen(.{ .reuse_address = true });
236236 defer server1.deinit();
237237
238 var server2 = try server1.listen_address.listen(.{ .reuse_port = true });
238 var server2 = try server1.listen_address.listen(.{ .reuse_address = true });
239239 defer server2.deinit();
240240}
241241
......@@ -315,7 +315,7 @@ test "listen on a unix socket, send bytes, receive bytes" {
315315 try testing.expectEqualSlices(u8, "Hello world!", buf[0..n]);
316316}
317317
318test "listen on a unix socket with reuse_port option" {
318test "listen on a unix socket with reuse_address option" {
319319 if (!net.has_unix_sockets) return error.SkipZigTest;
320320 // Windows doesn't implement reuse port option.
321321 if (builtin.os.tag == .windows) return error.SkipZigTest;
......@@ -326,7 +326,7 @@ test "listen on a unix socket with reuse_port option" {
326326 const socket_addr = try net.Address.initUnix(socket_path);
327327 defer std.fs.cwd().deleteFile(socket_path) catch {};
328328
329 var server = try socket_addr.listen(.{ .reuse_port = true });
329 var server = try socket_addr.listen(.{ .reuse_address = true });
330330 server.deinit();
331331}
332332
lib/std/os/windows.zig+1-4
......@@ -146,7 +146,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN
146146 // call has failed. There is not really a sane way to handle
147147 // this other than retrying the creation after the OS finishes
148148 // the deletion.
149 std.time.sleep(std.time.ns_per_ms);
149 std.Thread.sleep(std.time.ns_per_ms);
150150 continue;
151151 },
152152 .VIRUS_INFECTED, .VIRUS_DELETED => return error.AntivirusInterference,
......@@ -2848,9 +2848,6 @@ pub const STD_OUTPUT_HANDLE = maxInt(DWORD) - 11 + 1;
28482848/// The standard error device. Initially, this is the active console screen buffer, CONOUT$.
28492849pub const STD_ERROR_HANDLE = maxInt(DWORD) - 12 + 1;
28502850
2851/// Deprecated; use `std.builtin.CallingConvention.winapi` instead.
2852pub const WINAPI: std.builtin.CallingConvention = .winapi;
2853
28542851pub const BOOL = c_int;
28552852pub const BOOLEAN = BYTE;
28562853pub const BYTE = u8;
lib/std/posix/test.zig+1-1
......@@ -1161,7 +1161,7 @@ test "POSIX file locking with fcntl" {
11611161 posix.exit(0);
11621162 } else {
11631163 // parent waits for child to get shared lock:
1164 std.time.sleep(1 * std.time.ns_per_ms);
1164 std.Thread.sleep(1 * std.time.ns_per_ms);
11651165 // parent expects deadlock when attempting to upgrade the shared lock to exclusive:
11661166 struct_flock.start = 1;
11671167 struct_flock.type = posix.F.WRLCK;
lib/std/time.zig-3
......@@ -8,9 +8,6 @@ const posix = std.posix;
88
99pub const epoch = @import("time/epoch.zig");
1010
11/// Deprecated: moved to std.Thread.sleep
12pub const sleep = std.Thread.sleep;
13
1411/// Get a calendar timestamp, in seconds, relative to UTC 1970-01-01.
1512/// Precision of timing depends on the hardware and operating system.
1613/// The return value is signed because it is possible to have a date that is
lib/std/unicode.zig-10
......@@ -972,8 +972,6 @@ pub fn utf16LeToUtf8ArrayList(result: *std.ArrayList(u8), utf16le: []const u16)
972972 return utf16LeToUtf8ArrayListImpl(result, utf16le, .cannot_encode_surrogate_half);
973973}
974974
975pub const utf16leToUtf8Alloc = @compileError("deprecated; renamed to utf16LeToUtf8Alloc");
976
977975/// Caller must free returned memory.
978976pub fn utf16LeToUtf8Alloc(allocator: mem.Allocator, utf16le: []const u16) Utf16LeToUtf8AllocError![]u8 {
979977 // optimistically guess that it will all be ascii.
......@@ -984,8 +982,6 @@ pub fn utf16LeToUtf8Alloc(allocator: mem.Allocator, utf16le: []const u16) Utf16L
984982 return result.toOwnedSlice();
985983}
986984
987pub const utf16leToUtf8AllocZ = @compileError("deprecated; renamed to utf16LeToUtf8AllocZ");
988
989985/// Caller must free returned memory.
990986pub fn utf16LeToUtf8AllocZ(allocator: mem.Allocator, utf16le: []const u16) Utf16LeToUtf8AllocError![:0]u8 {
991987 // optimistically guess that it will all be ascii (and allocate space for the null terminator)
......@@ -1054,8 +1050,6 @@ fn utf16LeToUtf8Impl(utf8: []u8, utf16le: []const u16, comptime surrogates: Surr
10541050 return dest_index;
10551051}
10561052
1057pub const utf16leToUtf8 = @compileError("deprecated; renamed to utf16LeToUtf8");
1058
10591053pub fn utf16LeToUtf8(utf8: []u8, utf16le: []const u16) Utf16LeToUtf8Error!usize {
10601054 return utf16LeToUtf8Impl(utf8, utf16le, .cannot_encode_surrogate_half);
10611055}
......@@ -1175,8 +1169,6 @@ pub fn utf8ToUtf16LeAlloc(allocator: mem.Allocator, utf8: []const u8) error{ Inv
11751169 return result.toOwnedSlice();
11761170}
11771171
1178pub const utf8ToUtf16LeWithNull = @compileError("deprecated; renamed to utf8ToUtf16LeAllocZ");
1179
11801172pub fn utf8ToUtf16LeAllocZ(allocator: mem.Allocator, utf8: []const u8) error{ InvalidUtf8, OutOfMemory }![:0]u16 {
11811173 // optimistically guess that it will not require surrogate pairs
11821174 var result = try std.ArrayList(u16).initCapacity(allocator, utf8.len + 1);
......@@ -1487,8 +1479,6 @@ fn formatUtf16Le(utf16le: []const u16, writer: *std.io.Writer) std.io.Writer.Err
14871479 try writer.writeAll(buf[0..u8len]);
14881480}
14891481
1490pub const fmtUtf16le = @compileError("deprecated; renamed to fmtUtf16Le");
1491
14921482/// Return a Formatter for a (potentially ill-formed) UTF-16 LE string,
14931483/// which will be converted to UTF-8 during formatting.
14941484/// Unpaired surrogates are replaced by the replacement character (U+FFFD).
lib/std/valgrind.zig-12
......@@ -200,18 +200,6 @@ pub fn nonSimdCall3(func: fn (usize, usize, usize, usize) usize, a1: usize, a2:
200200 return doClientRequestExpr(0, .ClientCall3, @intFromPtr(func), a1, a2, a3, 0);
201201}
202202
203/// Deprecated: use `nonSimdCall0`
204pub const nonSIMDCall0 = nonSimdCall0;
205
206/// Deprecated: use `nonSimdCall1`
207pub const nonSIMDCall1 = nonSimdCall1;
208
209/// Deprecated: use `nonSimdCall2`
210pub const nonSIMDCall2 = nonSimdCall2;
211
212/// Deprecated: use `nonSimdCall3`
213pub const nonSIMDCall3 = nonSimdCall3;
214
215203/// Counts the number of errors that have been recorded by a tool. Nb:
216204/// the tool must record the errors with VG_(maybe_record_error)() or
217205/// VG_(unique_error)() for them to be counted.
lib/std/valgrind/callgrind.zig-2
......@@ -10,8 +10,6 @@ pub const ClientRequest = enum(usize) {
1010 StopInstrumentation,
1111};
1212
13pub const CallgrindClientRequest = @compileError("std.valgrind.callgrind.CallgrindClientRequest renamed to std.valgrind.callgrind.ClientRequest");
14
1513fn doClientRequestExpr(default: usize, request: ClientRequest, a1: usize, a2: usize, a3: usize, a4: usize, a5: usize) usize {
1614 return valgrind.doClientRequest(default, @as(usize, @intCast(@intFromEnum(request))), a1, a2, a3, a4, a5);
1715}
lib/std/valgrind/memcheck.zig-2
......@@ -20,8 +20,6 @@ pub const ClientRequest = enum(usize) {
2020 DisableAddrErrorReportingInRange,
2121};
2222
23pub const MemCheckClientRequest = @compileError("std.valgrind.memcheck.MemCheckClientRequest renamed to std.valgrind.memcheck.ClientRequest");
24
2523fn doClientRequestExpr(default: usize, request: ClientRequest, a1: usize, a2: usize, a3: usize, a4: usize, a5: usize) usize {
2624 return valgrind.doClientRequest(default, @as(usize, @intCast(@intFromEnum(request))), a1, a2, a3, a4, a5);
2725}
lib/std/zig.zig+6-10
......@@ -17,7 +17,6 @@ pub const Zir = @import("zig/Zir.zig");
1717pub const Zoir = @import("zig/Zoir.zig");
1818pub const ZonGen = @import("zig/ZonGen.zig");
1919pub const system = @import("zig/system.zig");
20pub const CrossTarget = @compileError("deprecated; use std.Target.Query");
2120pub const BuiltinFn = @import("zig/BuiltinFn.zig");
2221pub const AstRlAnnotate = @import("zig/AstRlAnnotate.zig");
2322pub const LibCInstallation = @import("zig/LibCInstallation.zig");
......@@ -604,7 +603,7 @@ pub fn putAstErrorsIntoBundle(
604603
605604pub fn resolveTargetQueryOrFatal(target_query: std.Target.Query) std.Target {
606605 return std.zig.system.resolveTargetQuery(target_query) catch |err|
607 fatal("unable to resolve target: {s}", .{@errorName(err)});
606 std.process.fatal("unable to resolve target: {s}", .{@errorName(err)});
608607}
609608
610609pub fn parseTargetQueryOrReportFatalError(
......@@ -628,7 +627,7 @@ pub fn parseTargetQueryOrReportFatalError(
628627 @tagName(diags.arch.?), help_text.items,
629628 });
630629 }
631 fatal("unknown CPU: '{s}'", .{diags.cpu_name.?});
630 std.process.fatal("unknown CPU: '{s}'", .{diags.cpu_name.?});
632631 },
633632 error.UnknownCpuFeature => {
634633 help: {
......@@ -641,7 +640,7 @@ pub fn parseTargetQueryOrReportFatalError(
641640 @tagName(diags.arch.?), help_text.items,
642641 });
643642 }
644 fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});
643 std.process.fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});
645644 },
646645 error.UnknownObjectFormat => {
647646 help: {
......@@ -652,7 +651,7 @@ pub fn parseTargetQueryOrReportFatalError(
652651 }
653652 std.log.info("available object formats:\n{s}", .{help_text.items});
654653 }
655 fatal("unknown object format: '{s}'", .{opts.object_format.?});
654 std.process.fatal("unknown object format: '{s}'", .{opts.object_format.?});
656655 },
657656 error.UnknownArchitecture => {
658657 help: {
......@@ -663,17 +662,14 @@ pub fn parseTargetQueryOrReportFatalError(
663662 }
664663 std.log.info("available architectures:\n{s} native\n", .{help_text.items});
665664 }
666 fatal("unknown architecture: '{s}'", .{diags.unknown_architecture_name.?});
665 std.process.fatal("unknown architecture: '{s}'", .{diags.unknown_architecture_name.?});
667666 },
668 else => |e| fatal("unable to parse target query '{s}': {s}", .{
667 else => |e| std.process.fatal("unable to parse target query '{s}': {s}", .{
669668 opts.arch_os_abi, @errorName(e),
670669 }),
671670 };
672671}
673672
674/// Deprecated; see `std.process.fatal`.
675pub const fatal = std.process.fatal;
676
677673/// Collects all the environment variables that Zig could possibly inspect, so
678674/// that we can do reflection on this and print them with `zig env`.
679675pub const EnvVar = enum {
lib/std/zig/c_translation.zig-3
......@@ -254,9 +254,6 @@ test "sizeof" {
254254
255255pub const CIntLiteralBase = enum { decimal, octal, hex };
256256
257/// Deprecated: use `CIntLiteralBase`
258pub const CIntLiteralRadix = CIntLiteralBase;
259
260257fn PromoteIntLiteralReturnType(comptime SuffixType: type, comptime number: comptime_int, comptime base: CIntLiteralBase) type {
261258 const signed_decimal = [_]type{ c_int, c_long, c_longlong, c_ulonglong };
262259 const signed_oct_hex = [_]type{ c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong };
lib/std/zig/llvm/Builder.zig+27-27
......@@ -10638,7 +10638,7 @@ fn fnTypeAssumeCapacity(
1063810638 const Adapter = struct {
1063910639 builder: *const Builder,
1064010640 pub fn hash(_: @This(), key: Key) u32 {
10641 var hasher = std.hash.Wyhash.init(comptime std.hash.uint32(@intFromEnum(tag)));
10641 var hasher = std.hash.Wyhash.init(comptime std.hash.int(@intFromEnum(tag)));
1064210642 hasher.update(std.mem.asBytes(&key.ret));
1064310643 hasher.update(std.mem.sliceAsBytes(key.params));
1064410644 return @truncate(hasher.final());
......@@ -10698,7 +10698,7 @@ fn vectorTypeAssumeCapacity(
1069810698 builder: *const Builder,
1069910699 pub fn hash(_: @This(), key: Type.Vector) u32 {
1070010700 return @truncate(std.hash.Wyhash.hash(
10701 comptime std.hash.uint32(@intFromEnum(tag)),
10701 comptime std.hash.int(@intFromEnum(tag)),
1070210702 std.mem.asBytes(&key),
1070310703 ));
1070410704 }
......@@ -10727,7 +10727,7 @@ fn arrayTypeAssumeCapacity(self: *Builder, len: u64, child: Type) Type {
1072710727 builder: *const Builder,
1072810728 pub fn hash(_: @This(), key: Type.Vector) u32 {
1072910729 return @truncate(std.hash.Wyhash.hash(
10730 comptime std.hash.uint32(@intFromEnum(Type.Tag.small_array)),
10730 comptime std.hash.int(@intFromEnum(Type.Tag.small_array)),
1073110731 std.mem.asBytes(&key),
1073210732 ));
1073310733 }
......@@ -10753,7 +10753,7 @@ fn arrayTypeAssumeCapacity(self: *Builder, len: u64, child: Type) Type {
1075310753 builder: *const Builder,
1075410754 pub fn hash(_: @This(), key: Type.Array) u32 {
1075510755 return @truncate(std.hash.Wyhash.hash(
10756 comptime std.hash.uint32(@intFromEnum(Type.Tag.array)),
10756 comptime std.hash.int(@intFromEnum(Type.Tag.array)),
1075710757 std.mem.asBytes(&key),
1075810758 ));
1075910759 }
......@@ -10794,7 +10794,7 @@ fn structTypeAssumeCapacity(
1079410794 builder: *const Builder,
1079510795 pub fn hash(_: @This(), key: []const Type) u32 {
1079610796 return @truncate(std.hash.Wyhash.hash(
10797 comptime std.hash.uint32(@intFromEnum(tag)),
10797 comptime std.hash.int(@intFromEnum(tag)),
1079810798 std.mem.sliceAsBytes(key),
1079910799 ));
1080010800 }
......@@ -10826,7 +10826,7 @@ fn opaqueTypeAssumeCapacity(self: *Builder, name: String) Type {
1082610826 builder: *const Builder,
1082710827 pub fn hash(_: @This(), key: String) u32 {
1082810828 return @truncate(std.hash.Wyhash.hash(
10829 comptime std.hash.uint32(@intFromEnum(Type.Tag.named_structure)),
10829 comptime std.hash.int(@intFromEnum(Type.Tag.named_structure)),
1083010830 std.mem.asBytes(&key),
1083110831 ));
1083210832 }
......@@ -10887,7 +10887,7 @@ fn getOrPutTypeNoExtraAssumeCapacity(self: *Builder, item: Type.Item) struct { n
1088710887 builder: *const Builder,
1088810888 pub fn hash(_: @This(), key: Type.Item) u32 {
1088910889 return @truncate(std.hash.Wyhash.hash(
10890 comptime std.hash.uint32(@intFromEnum(Type.Tag.simple)),
10890 comptime std.hash.int(@intFromEnum(Type.Tag.simple)),
1089110891 std.mem.asBytes(&key),
1089210892 ));
1089310893 }
......@@ -11021,7 +11021,7 @@ fn bigIntConstAssumeCapacity(
1102111021 const Adapter = struct {
1102211022 builder: *const Builder,
1102311023 pub fn hash(_: @This(), key: Key) u32 {
11024 var hasher = std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(key.tag)));
11024 var hasher = std.hash.Wyhash.init(std.hash.int(@intFromEnum(key.tag)));
1102511025 hasher.update(std.mem.asBytes(&key.type));
1102611026 hasher.update(std.mem.sliceAsBytes(key.limbs));
1102711027 return @truncate(hasher.final());
......@@ -11084,7 +11084,7 @@ fn doubleConstAssumeCapacity(self: *Builder, val: f64) Constant {
1108411084 builder: *const Builder,
1108511085 pub fn hash(_: @This(), key: f64) u32 {
1108611086 return @truncate(std.hash.Wyhash.hash(
11087 comptime std.hash.uint32(@intFromEnum(Constant.Tag.double)),
11087 comptime std.hash.int(@intFromEnum(Constant.Tag.double)),
1108811088 std.mem.asBytes(&key),
1108911089 ));
1109011090 }
......@@ -11115,7 +11115,7 @@ fn fp128ConstAssumeCapacity(self: *Builder, val: f128) Constant {
1111511115 builder: *const Builder,
1111611116 pub fn hash(_: @This(), key: f128) u32 {
1111711117 return @truncate(std.hash.Wyhash.hash(
11118 comptime std.hash.uint32(@intFromEnum(Constant.Tag.fp128)),
11118 comptime std.hash.int(@intFromEnum(Constant.Tag.fp128)),
1111911119 std.mem.asBytes(&key),
1112011120 ));
1112111121 }
......@@ -11149,7 +11149,7 @@ fn x86_fp80ConstAssumeCapacity(self: *Builder, val: f80) Constant {
1114911149 builder: *const Builder,
1115011150 pub fn hash(_: @This(), key: f80) u32 {
1115111151 return @truncate(std.hash.Wyhash.hash(
11152 comptime std.hash.uint32(@intFromEnum(Constant.Tag.x86_fp80)),
11152 comptime std.hash.int(@intFromEnum(Constant.Tag.x86_fp80)),
1115311153 std.mem.asBytes(&key)[0..10],
1115411154 ));
1115511155 }
......@@ -11182,7 +11182,7 @@ fn ppc_fp128ConstAssumeCapacity(self: *Builder, val: [2]f64) Constant {
1118211182 builder: *const Builder,
1118311183 pub fn hash(_: @This(), key: [2]f64) u32 {
1118411184 return @truncate(std.hash.Wyhash.hash(
11185 comptime std.hash.uint32(@intFromEnum(Constant.Tag.ppc_fp128)),
11185 comptime std.hash.int(@intFromEnum(Constant.Tag.ppc_fp128)),
1118611186 std.mem.asBytes(&key),
1118711187 ));
1118811188 }
......@@ -11317,7 +11317,7 @@ fn splatConstAssumeCapacity(self: *Builder, ty: Type, val: Constant) Constant {
1131711317 builder: *const Builder,
1131811318 pub fn hash(_: @This(), key: Constant.Splat) u32 {
1131911319 return @truncate(std.hash.Wyhash.hash(
11320 comptime std.hash.uint32(@intFromEnum(Constant.Tag.splat)),
11320 comptime std.hash.int(@intFromEnum(Constant.Tag.splat)),
1132111321 std.mem.asBytes(&key),
1132211322 ));
1132311323 }
......@@ -11420,7 +11420,7 @@ fn blockAddrConstAssumeCapacity(
1142011420 builder: *const Builder,
1142111421 pub fn hash(_: @This(), key: Constant.BlockAddress) u32 {
1142211422 return @truncate(std.hash.Wyhash.hash(
11423 comptime std.hash.uint32(@intFromEnum(Constant.Tag.blockaddress)),
11423 comptime std.hash.int(@intFromEnum(Constant.Tag.blockaddress)),
1142411424 std.mem.asBytes(&key),
1142511425 ));
1142611426 }
......@@ -11546,7 +11546,7 @@ fn castConstAssumeCapacity(self: *Builder, tag: Constant.Tag, val: Constant, ty:
1154611546 builder: *const Builder,
1154711547 pub fn hash(_: @This(), key: Key) u32 {
1154811548 return @truncate(std.hash.Wyhash.hash(
11549 std.hash.uint32(@intFromEnum(key.tag)),
11549 std.hash.int(@intFromEnum(key.tag)),
1155011550 std.mem.asBytes(&key.cast),
1155111551 ));
1155211552 }
......@@ -11621,7 +11621,7 @@ fn gepConstAssumeCapacity(
1162111621 const Adapter = struct {
1162211622 builder: *const Builder,
1162311623 pub fn hash(_: @This(), key: Key) u32 {
11624 var hasher = std.hash.Wyhash.init(comptime std.hash.uint32(@intFromEnum(tag)));
11624 var hasher = std.hash.Wyhash.init(comptime std.hash.int(@intFromEnum(tag)));
1162511625 hasher.update(std.mem.asBytes(&key.type));
1162611626 hasher.update(std.mem.asBytes(&key.base));
1162711627 hasher.update(std.mem.asBytes(&key.inrange));
......@@ -11685,7 +11685,7 @@ fn binConstAssumeCapacity(
1168511685 builder: *const Builder,
1168611686 pub fn hash(_: @This(), key: Key) u32 {
1168711687 return @truncate(std.hash.Wyhash.hash(
11688 std.hash.uint32(@intFromEnum(key.tag)),
11688 std.hash.int(@intFromEnum(key.tag)),
1168911689 std.mem.asBytes(&key.extra),
1169011690 ));
1169111691 }
......@@ -11723,7 +11723,7 @@ fn asmConstAssumeCapacity(
1172311723 builder: *const Builder,
1172411724 pub fn hash(_: @This(), key: Key) u32 {
1172511725 return @truncate(std.hash.Wyhash.hash(
11726 std.hash.uint32(@intFromEnum(key.tag)),
11726 std.hash.int(@intFromEnum(key.tag)),
1172711727 std.mem.asBytes(&key.extra),
1172811728 ));
1172911729 }
......@@ -11773,7 +11773,7 @@ fn getOrPutConstantNoExtraAssumeCapacity(
1177311773 builder: *const Builder,
1177411774 pub fn hash(_: @This(), key: Constant.Item) u32 {
1177511775 return @truncate(std.hash.Wyhash.hash(
11776 std.hash.uint32(@intFromEnum(key.tag)),
11776 std.hash.int(@intFromEnum(key.tag)),
1177711777 std.mem.asBytes(&key.data),
1177811778 ));
1177911779 }
......@@ -11804,7 +11804,7 @@ fn getOrPutConstantAggregateAssumeCapacity(
1180411804 const Adapter = struct {
1180511805 builder: *const Builder,
1180611806 pub fn hash(_: @This(), key: Key) u32 {
11807 var hasher = std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(key.tag)));
11807 var hasher = std.hash.Wyhash.init(std.hash.int(@intFromEnum(key.tag)));
1180811808 hasher.update(std.mem.asBytes(&key.type));
1180911809 hasher.update(std.mem.sliceAsBytes(key.vals));
1181011810 return @truncate(hasher.final());
......@@ -12421,7 +12421,7 @@ fn metadataSimpleAssumeCapacity(self: *Builder, tag: Metadata.Tag, value: anytyp
1242112421 const Adapter = struct {
1242212422 builder: *const Builder,
1242312423 pub fn hash(_: @This(), key: Key) u32 {
12424 var hasher = std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(key.tag)));
12424 var hasher = std.hash.Wyhash.init(std.hash.int(@intFromEnum(key.tag)));
1242512425 inline for (std.meta.fields(@TypeOf(value))) |field| {
1242612426 hasher.update(std.mem.asBytes(&@field(key.value, field.name)));
1242712427 }
......@@ -12457,7 +12457,7 @@ fn metadataDistinctAssumeCapacity(self: *Builder, tag: Metadata.Tag, value: anyt
1245712457 const Adapter = struct {
1245812458 pub fn hash(_: @This(), key: Key) u32 {
1245912459 return @truncate(std.hash.Wyhash.hash(
12460 std.hash.uint32(@intFromEnum(key.tag)),
12460 std.hash.int(@intFromEnum(key.tag)),
1246112461 std.mem.asBytes(&key.index),
1246212462 ));
1246312463 }
......@@ -12853,7 +12853,7 @@ fn debugEnumeratorAssumeCapacity(
1285312853 const Adapter = struct {
1285412854 builder: *const Builder,
1285512855 pub fn hash(_: @This(), key: Key) u32 {
12856 var hasher = std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(key.tag)));
12856 var hasher = std.hash.Wyhash.init(std.hash.int(@intFromEnum(key.tag)));
1285712857 hasher.update(std.mem.asBytes(&key.name));
1285812858 hasher.update(std.mem.asBytes(&key.bit_width));
1285912859 hasher.update(std.mem.sliceAsBytes(key.value.limbs));
......@@ -12935,7 +12935,7 @@ fn debugExpressionAssumeCapacity(
1293512935 const Adapter = struct {
1293612936 builder: *const Builder,
1293712937 pub fn hash(_: @This(), key: Key) u32 {
12938 var hasher = comptime std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(Metadata.Tag.expression)));
12938 var hasher = comptime std.hash.Wyhash.init(std.hash.int(@intFromEnum(Metadata.Tag.expression)));
1293912939 hasher.update(std.mem.sliceAsBytes(key.elements));
1294012940 return @truncate(hasher.final());
1294112941 }
......@@ -12981,7 +12981,7 @@ fn metadataTupleAssumeCapacity(
1298112981 const Adapter = struct {
1298212982 builder: *const Builder,
1298312983 pub fn hash(_: @This(), key: Key) u32 {
12984 var hasher = comptime std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(Metadata.Tag.tuple)));
12984 var hasher = comptime std.hash.Wyhash.init(std.hash.int(@intFromEnum(Metadata.Tag.tuple)));
1298512985 hasher.update(std.mem.sliceAsBytes(key.elements));
1298612986 return @truncate(hasher.final());
1298712987 }
......@@ -13029,7 +13029,7 @@ fn strTupleAssumeCapacity(
1302913029 const Adapter = struct {
1303013030 builder: *const Builder,
1303113031 pub fn hash(_: @This(), key: Key) u32 {
13032 var hasher = comptime std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(Metadata.Tag.tuple)));
13032 var hasher = comptime std.hash.Wyhash.init(std.hash.int(@intFromEnum(Metadata.Tag.tuple)));
1303313033 hasher.update(std.mem.sliceAsBytes(key.elements));
1303413034 return @truncate(hasher.final());
1303513035 }
......@@ -13159,7 +13159,7 @@ fn metadataConstantAssumeCapacity(self: *Builder, constant: Constant) Metadata {
1315913159 const Adapter = struct {
1316013160 builder: *const Builder,
1316113161 pub fn hash(_: @This(), key: Constant) u32 {
13162 var hasher = comptime std.hash.Wyhash.init(std.hash.uint32(@intFromEnum(Metadata.Tag.constant)));
13162 var hasher = comptime std.hash.Wyhash.init(std.hash.int(@intFromEnum(Metadata.Tag.constant)));
1316313163 hasher.update(std.mem.asBytes(&key));
1316413164 return @truncate(hasher.final());
1316513165 }
src/InternPool.zig+4-4
......@@ -1861,7 +1861,7 @@ pub const NullTerminatedString = enum(u32) {
18611861
18621862 pub fn hash(ctx: @This(), a: NullTerminatedString) u32 {
18631863 _ = ctx;
1864 return std.hash.uint32(@intFromEnum(a));
1864 return std.hash.int(@intFromEnum(a));
18651865 }
18661866 };
18671867
......@@ -4740,7 +4740,7 @@ pub const Index = enum(u32) {
47404740
47414741 pub fn hash(ctx: @This(), a: Index) u32 {
47424742 _ = ctx;
4743 return std.hash.uint32(@intFromEnum(a));
4743 return std.hash.int(@intFromEnum(a));
47444744 }
47454745 };
47464746
......@@ -12725,7 +12725,7 @@ const GlobalErrorSet = struct {
1272512725 name: NullTerminatedString,
1272612726 ) Allocator.Error!GlobalErrorSet.Index {
1272712727 if (name == .empty) return .none;
12728 const hash = std.hash.uint32(@intFromEnum(name));
12728 const hash = std.hash.int(@intFromEnum(name));
1272912729 var map = ges.shared.map.acquire();
1273012730 const Map = @TypeOf(map);
1273112731 var map_mask = map.header().mask();
......@@ -12818,7 +12818,7 @@ const GlobalErrorSet = struct {
1281812818 name: NullTerminatedString,
1281912819 ) ?GlobalErrorSet.Index {
1282012820 if (name == .empty) return .none;
12821 const hash = std.hash.uint32(@intFromEnum(name));
12821 const hash = std.hash.int(@intFromEnum(name));
1282212822 const map = ges.shared.map.acquire();
1282312823 const map_mask = map.header().mask();
1282412824 const names_items = ges.shared.names.acquire().view().items(.@"0");
src/Zcu.zig+2-2
......@@ -808,7 +808,7 @@ pub const Namespace = struct {
808808
809809 pub fn hash(ctx: NavNameContext, nav: InternPool.Nav.Index) u32 {
810810 const name = ctx.zcu.intern_pool.getNav(nav).name;
811 return std.hash.uint32(@intFromEnum(name));
811 return std.hash.int(@intFromEnum(name));
812812 }
813813
814814 pub fn eql(ctx: NavNameContext, a_nav: InternPool.Nav.Index, b_nav: InternPool.Nav.Index, b_index: usize) bool {
......@@ -824,7 +824,7 @@ pub const Namespace = struct {
824824
825825 pub fn hash(ctx: NameAdapter, s: InternPool.NullTerminatedString) u32 {
826826 _ = ctx;
827 return std.hash.uint32(@intFromEnum(s));
827 return std.hash.int(@intFromEnum(s));
828828 }
829829
830830 pub fn eql(ctx: NameAdapter, a: InternPool.NullTerminatedString, b_nav: InternPool.Nav.Index, b_index: usize) bool {
src/arch/wasm/CodeGen.zig+4-4
......@@ -3974,7 +3974,7 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Inner
39743974 var width_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
39753975 width_bigint.sub(max_bigint, min_bigint);
39763976 width_bigint.addScalar(width_bigint.toConst(), 1);
3977 break :width width_bigint.toConst().to(u32) catch null;
3977 break :width width_bigint.toConst().toInt(u32) catch null;
39783978 };
39793979
39803980 try cg.startBlock(.block, .empty); // whole switch block start
......@@ -4015,7 +4015,7 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Inner
40154015 const val_bigint = val.toBigInt(&val_space, zcu);
40164016 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
40174017 index_bigint.sub(val_bigint, min_bigint);
4018 branch_list[index_bigint.toConst().to(u32) catch unreachable] = case.idx;
4018 branch_list[index_bigint.toConst().toInt(u32) catch unreachable] = case.idx;
40194019 }
40204020 for (case.ranges) |range| {
40214021 var low_space: Value.BigIntSpace = undefined;
......@@ -4024,9 +4024,9 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Inner
40244024 const high_bigint = Value.fromInterned(range[1].toInterned().?).toBigInt(&high_space, zcu);
40254025 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
40264026 index_bigint.sub(low_bigint, min_bigint);
4027 const start = index_bigint.toConst().to(u32) catch unreachable;
4027 const start = index_bigint.toConst().toInt(u32) catch unreachable;
40284028 index_bigint.sub(high_bigint, min_bigint);
4029 const end = (index_bigint.toConst().to(u32) catch unreachable) + 1;
4029 const end = (index_bigint.toConst().toInt(u32) catch unreachable) + 1;
40304030 @memset(branch_list[start..end], case.idx);
40314031 }
40324032 }
src/arch/wasm/Emit.zig+1-1
......@@ -263,7 +263,7 @@ pub fn lowerToCode(emit: *Emit) Error!void {
263263 code.appendNTimesAssumeCapacity(0, 5);
264264 } else {
265265 const sp_global: Wasm.GlobalIndex = .stack_pointer;
266 std.leb.writeULEB128(code.fixedWriter(), @intFromEnum(sp_global)) catch unreachable;
266 std.leb.writeUleb128(code.fixedWriter(), @intFromEnum(sp_global)) catch unreachable;
267267 }
268268
269269 inst += 1;
src/arch/wasm/Mir.zig+2-2
......@@ -687,7 +687,7 @@ pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayListUnmanaged(u8)) st
687687 const sp_global: Wasm.GlobalIndex = .stack_pointer;
688688 // load stack pointer
689689 code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.global_get));
690 std.leb.writeULEB128(code.fixedWriter(), @intFromEnum(sp_global)) catch unreachable;
690 std.leb.writeUleb128(code.fixedWriter(), @intFromEnum(sp_global)) catch unreachable;
691691 // store stack pointer so we can restore it when we return from the function
692692 code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.local_tee));
693693 leb.writeUleb128(code.fixedWriter(), mir.prologue.sp_local) catch unreachable;
......@@ -710,7 +710,7 @@ pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayListUnmanaged(u8)) st
710710 // Store the current stack pointer value into the global stack pointer so other function calls will
711711 // start from this value instead and not overwrite the current stack.
712712 code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.global_set));
713 std.leb.writeULEB128(code.fixedWriter(), @intFromEnum(sp_global)) catch unreachable;
713 std.leb.writeUleb128(code.fixedWriter(), @intFromEnum(sp_global)) catch unreachable;
714714 }
715715
716716 var emit: Emit = .{
src/arch/x86_64/CodeGen.zig+4-4
......@@ -179277,7 +179277,7 @@ fn lowerSwitchBr(
179277179277 var table_len_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
179278179278 table_len_bigint.sub(max_bigint, min_bigint);
179279179279 assert(table_len_bigint.positive); // min <= max
179280 break :table_len @as(u11, table_len_bigint.toConst().to(u10) catch break :table) + 1; // no more than a 1024 entry table
179280 break :table_len @as(u11, table_len_bigint.toConst().toInt(u10) catch break :table) + 1; // no more than a 1024 entry table
179281179281 };
179282179282 assert(prong_items <= table_len); // each prong item introduces at least one unique integer to the range
179283179283 if (prong_items < table_len >> 2) break :table; // no more than 75% waste
......@@ -179353,7 +179353,7 @@ fn lowerSwitchBr(
179353179353 const val_bigint = val.toBigInt(&val_space, zcu);
179354179354 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
179355179355 index_bigint.sub(val_bigint, min_bigint);
179356 table[index_bigint.toConst().to(u10) catch unreachable] = @intCast(cg.mir_instructions.len);
179356 table[index_bigint.toConst().toInt(u10) catch unreachable] = @intCast(cg.mir_instructions.len);
179357179357 }
179358179358 for (case.ranges) |range| {
179359179359 var low_space: Value.BigIntSpace = undefined;
......@@ -179362,9 +179362,9 @@ fn lowerSwitchBr(
179362179362 const high_bigint = Value.fromInterned(range[1].toInterned().?).toBigInt(&high_space, zcu);
179363179363 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
179364179364 index_bigint.sub(low_bigint, min_bigint);
179365 const start = index_bigint.toConst().to(u10) catch unreachable;
179365 const start = index_bigint.toConst().toInt(u10) catch unreachable;
179366179366 index_bigint.sub(high_bigint, min_bigint);
179367 const end = @as(u11, index_bigint.toConst().to(u10) catch unreachable) + 1;
179367 const end = @as(u11, index_bigint.toConst().toInt(u10) catch unreachable) + 1;
179368179368 @memset(table[start..end], @intCast(cg.mir_instructions.len));
179369179369 }
179370179370 }
src/link/MachO/dyld_info/Trie.zig+8-8
......@@ -189,9 +189,9 @@ fn finalizeNode(self: *Trie, node_index: Node.Index, offset_in_trie: u32) !Final
189189 if (slice.items(.is_terminal)[node_index]) {
190190 const export_flags = slice.items(.export_flags)[node_index];
191191 const vmaddr_offset = slice.items(.vmaddr_offset)[node_index];
192 try leb.writeULEB128(writer, export_flags);
193 try leb.writeULEB128(writer, vmaddr_offset);
194 try leb.writeULEB128(writer, stream.bytes_written);
192 try leb.writeUleb128(writer, export_flags);
193 try leb.writeUleb128(writer, vmaddr_offset);
194 try leb.writeUleb128(writer, stream.bytes_written);
195195 } else {
196196 node_size += 1; // 0x0 for non-terminal nodes
197197 }
......@@ -201,7 +201,7 @@ fn finalizeNode(self: *Trie, node_index: Node.Index, offset_in_trie: u32) !Final
201201 const edge = &self.edges.items[edge_index];
202202 const next_node_offset = slice.items(.trie_offset)[edge.node];
203203 node_size += @intCast(edge.label.len + 1);
204 try leb.writeULEB128(writer, next_node_offset);
204 try leb.writeUleb128(writer, next_node_offset);
205205 }
206206
207207 const trie_offset = slice.items(.trie_offset)[node_index];
......@@ -251,13 +251,13 @@ fn writeNode(self: *Trie, node_index: Node.Index, writer: anytype) !void {
251251 // TODO Implement for special flags.
252252 assert(export_flags & macho.EXPORT_SYMBOL_FLAGS_REEXPORT == 0 and
253253 export_flags & macho.EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER == 0);
254 try leb.writeULEB128(info_stream.writer(), export_flags);
255 try leb.writeULEB128(info_stream.writer(), vmaddr_offset);
254 try leb.writeUleb128(info_stream.writer(), export_flags);
255 try leb.writeUleb128(info_stream.writer(), vmaddr_offset);
256256
257257 // Encode the size of the terminal node info.
258258 var size_buf: [@sizeOf(u64)]u8 = undefined;
259259 var size_stream = std.io.fixedBufferStream(&size_buf);
260 try leb.writeULEB128(size_stream.writer(), info_stream.pos);
260 try leb.writeUleb128(size_stream.writer(), info_stream.pos);
261261
262262 // Now, write them to the output stream.
263263 try writer.writeAll(size_buf[0..size_stream.pos]);
......@@ -274,7 +274,7 @@ fn writeNode(self: *Trie, node_index: Node.Index, writer: anytype) !void {
274274 // Write edge label and offset to next node in trie.
275275 try writer.writeAll(edge.label);
276276 try writer.writeByte(0);
277 try leb.writeULEB128(writer, slice.items(.trie_offset)[edge.node]);
277 try leb.writeUleb128(writer, slice.items(.trie_offset)[edge.node]);
278278 }
279279}
280280
src/link/Wasm/Flush.zig+1-1
......@@ -146,7 +146,7 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {
146146 const int_tag_ty = Zcu.Type.fromInterned(data.ip_index).intTagType(zcu);
147147 gop.value_ptr.* = .{ .tag_name = .{
148148 .symbol_name = try wasm.internStringFmt("__zig_tag_name_{d}", .{@intFromEnum(data.ip_index)}),
149 .type_index = try wasm.internFunctionType(.Unspecified, &.{int_tag_ty.ip_index}, .slice_const_u8_sentinel_0, target),
149 .type_index = try wasm.internFunctionType(.auto, &.{int_tag_ty.ip_index}, .slice_const_u8_sentinel_0, target),
150150 .table_index = @intCast(wasm.tag_name_offs.items.len),
151151 } };
152152 try wasm.functions.put(gpa, .fromZcuFunc(wasm, @enumFromInt(gop.index)), {});
test/behavior/fn.zig+4-4
......@@ -153,9 +153,9 @@ test "extern struct with stdcallcc fn pointer" {
153153 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
154154
155155 const S = extern struct {
156 ptr: *const fn () callconv(if (builtin.target.cpu.arch == .x86) .Stdcall else .c) i32,
156 ptr: *const fn () callconv(if (builtin.target.cpu.arch == .x86) .{ .x86_stdcall = .{} } else .c) i32,
157157
158 fn foo() callconv(if (builtin.target.cpu.arch == .x86) .Stdcall else .c) i32 {
158 fn foo() callconv(if (builtin.target.cpu.arch == .x86) .{ .x86_stdcall = .{} } else .c) i32 {
159159 return 1234;
160160 }
161161 };
......@@ -170,8 +170,8 @@ fn fComplexCallconvRet(x: u32) callconv(blk: {
170170 const s: struct { n: u32 } = .{ .n = nComplexCallconv };
171171 break :blk switch (s.n) {
172172 0 => .c,
173 1 => .Inline,
174 else => .Unspecified,
173 1 => .@"inline",
174 else => .auto,
175175 };
176176}) struct { x: u32 } {
177177 return .{ .x = x * x };
test/behavior/type.zig+1-1
......@@ -670,7 +670,7 @@ test "reified function type params initialized with field pointer" {
670670 };
671671 const Bar = @Type(.{
672672 .@"fn" = .{
673 .calling_convention = .Unspecified,
673 .calling_convention = .auto,
674674 .is_generic = false,
675675 .is_var_args = false,
676676 .return_type = void,
test/c_abi/main.zig+1-1
......@@ -5763,7 +5763,7 @@ test "f128 f128 struct" {
57635763}
57645764
57655765// The stdcall attribute on C functions is ignored when compiled on non-x86
5766const stdcall_callconv: std.builtin.CallingConvention = if (builtin.cpu.arch == .x86) .Stdcall else .C;
5766const stdcall_callconv: std.builtin.CallingConvention = if (builtin.cpu.arch == .x86) .{ .x86_stdcall = .{} } else .c;
57675767
57685768extern fn stdcall_scalars(i8, i16, i32, f32, f64) callconv(stdcall_callconv) void;
57695769test "Stdcall ABI scalars" {
test/cases/compile_errors/callconv_from_global_variable.zig+1-1
......@@ -1,4 +1,4 @@
1var cc: @import("std").builtin.CallingConvention = .C;
1var cc: @import("std").builtin.CallingConvention = .c;
22export fn foo() callconv(cc) void {}
33
44// error
test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig+1-1
......@@ -12,5 +12,5 @@ fn foo(set1: Set1) void {
1212// backend=stage2
1313// target=native
1414//
15// :7:21: error: expected type 'error{C,A}', found 'error{A,B}'
15// :7:21: error: expected type 'error{A,C}', found 'error{A,B}'
1616// :7:21: note: 'error.B' not a member of destination error set
test/cases/compile_errors/reify_type.Fn_with_is_generic_true.zig+1-1
......@@ -1,6 +1,6 @@
11const Foo = @Type(.{
22 .@"fn" = .{
3 .calling_convention = .Unspecified,
3 .calling_convention = .auto,
44 .is_generic = true,
55 .is_var_args = false,
66 .return_type = u0,
test/cases/compile_errors/reify_type.Fn_with_is_var_args_true_and_non-C_callconv.zig+1-1
......@@ -1,6 +1,6 @@
11const Foo = @Type(.{
22 .@"fn" = .{
3 .calling_convention = .Unspecified,
3 .calling_convention = .auto,
44 .is_generic = false,
55 .is_var_args = true,
66 .return_type = u0,
test/cases/compile_errors/reify_type.Fn_with_return_type_null.zig+1-1
......@@ -1,6 +1,6 @@
11const Foo = @Type(.{
22 .@"fn" = .{
3 .calling_convention = .Unspecified,
3 .calling_convention = .auto,
44 .is_generic = false,
55 .is_var_args = false,
66 .return_type = null,
test/src/LlvmIr.zig+14-12
......@@ -90,19 +90,21 @@ pub fn addCase(self: *LlvmIr, case: TestCase) void {
9090
9191 const obj = self.b.addObject(.{
9292 .name = "test",
93 .root_source_file = self.b.addWriteFiles().add("test.zig", case.source),
94 .use_llvm = true,
93 .root_module = self.b.createModule(.{
94 .root_source_file = self.b.addWriteFiles().add("test.zig", case.source),
9595
96 .code_model = case.params.code_model,
97 .error_tracing = case.params.error_tracing,
98 .omit_frame_pointer = case.params.omit_frame_pointer,
99 .optimize = case.params.optimize,
100 .pic = case.params.pic,
101 .sanitize_thread = case.params.sanitize_thread,
102 .single_threaded = case.params.single_threaded,
103 .strip = case.params.strip,
104 .target = target,
105 .unwind_tables = case.params.unwind_tables,
96 .code_model = case.params.code_model,
97 .error_tracing = case.params.error_tracing,
98 .omit_frame_pointer = case.params.omit_frame_pointer,
99 .optimize = case.params.optimize,
100 .pic = case.params.pic,
101 .sanitize_thread = case.params.sanitize_thread,
102 .single_threaded = case.params.single_threaded,
103 .strip = case.params.strip,
104 .target = target,
105 .unwind_tables = case.params.unwind_tables,
106 }),
107 .use_llvm = true,
106108 });
107109
108110 obj.dll_export_fns = case.params.dll_export_fns;
test/standalone/c_embed_path/build.zig+4-2
......@@ -8,8 +8,10 @@ pub fn build(b: *std.Build) void {
88
99 const exe = b.addExecutable(.{
1010 .name = "test",
11 .target = b.graph.host,
12 .optimize = optimize,
11 .root_module = b.createModule(.{
12 .target = b.graph.host,
13 .optimize = optimize,
14 }),
1315 });
1416 exe.addCSourceFile(.{
1517 .file = b.path("test.c"),
test/standalone/config_header/build.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22
33pub fn build(b: *std.Build) void {
44 const config_header = b.addConfigHeader(
5 .{ .style = .{ .autoconf = b.path("config.h.in") } },
5 .{ .style = .{ .autoconf_undef = b.path("config.h.in") } },
66 .{
77 .SOME_NO = null,
88 .SOME_TRUE = true,
tools/docgen.zig+1-1
......@@ -10,7 +10,7 @@ const mem = std.mem;
1010const testing = std.testing;
1111const Allocator = std.mem.Allocator;
1212const getExternalExecutor = std.zig.system.getExternalExecutor;
13const fatal = std.zig.fatal;
13const fatal = std.process.fatal;
1414
1515const max_doc_file_size = 10 * 1024 * 1024;
1616
tools/doctest.zig+1-1
......@@ -1,6 +1,6 @@
11const builtin = @import("builtin");
22const std = @import("std");
3const fatal = std.zig.fatal;
3const fatal = std.process.fatal;
44const mem = std.mem;
55const fs = std.fs;
66const process = std.process;
tools/migrate_langref.zig+1-1
......@@ -7,7 +7,7 @@ const mem = std.mem;
77const testing = std.testing;
88const Allocator = std.mem.Allocator;
99const max_doc_file_size = 10 * 1024 * 1024;
10const fatal = std.zig.fatal;
10const fatal = std.process.fatal;
1111
1212pub fn main() !void {
1313 var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator);