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 @@...@@ -1,7 +1,8 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn build(b: *std.Build) void {3pub fn build(b: *std.Build) void {
4 const lib = b.addSharedLibrary(.{4 const lib = b.addLibrary(.{
5 .linkage = .dynamic,
5 .name = "mathtest",6 .name = "mathtest",
6 .root_source_file = b.path("mathtest.zig"),7 .root_source_file = b.path("mathtest.zig"),
7 .version = .{ .major = 1, .minor = 0, .patch = 0 },8 .version = .{ .major = 1, .minor = 0, .patch = 0 },
doc/langref/test_noreturn_from_exit.zig+1-1
...@@ -3,7 +3,7 @@ const builtin = @import("builtin");...@@ -3,7 +3,7 @@ const builtin = @import("builtin");
3const native_arch = builtin.cpu.arch;3const native_arch = builtin.cpu.arch;
4const expect = std.testing.expect;4const 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;
7extern "kernel32" fn ExitProcess(exit_code: c_uint) callconv(WINAPI) noreturn;7extern "kernel32" fn ExitProcess(exit_code: c_uint) callconv(WINAPI) noreturn;
88
9test "foo" {9test "foo" {
lib/compiler/aro/aro/Parser.zig+1-1
...@@ -8259,7 +8259,7 @@ fn charLiteral(p: *Parser) Error!Result {...@@ -8259,7 +8259,7 @@ fn charLiteral(p: *Parser) Error!Result {
8259 const slice = char_kind.contentSlice(p.tokSlice(p.tok_i));8259 const slice = char_kind.contentSlice(p.tokSlice(p.tok_i));
82608260
8261 var is_multichar = false;8261 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])) {
8263 // fast path: single unescaped ASCII char8263 // fast path: single unescaped ASCII char
8264 val = slice[0];8264 val = slice[0];
8265 } else {8265 } else {
lib/compiler/aro_translate_c.zig+1-1
...@@ -1820,7 +1820,7 @@ pub fn main() !void {...@@ -1820,7 +1820,7 @@ pub fn main() !void {
1820 var tree = translate(gpa, &aro_comp, args) catch |err| switch (err) {1820 var tree = translate(gpa, &aro_comp, args) catch |err| switch (err) {
1821 error.ParsingFailed, error.FatalError => renderErrorsAndExit(&aro_comp),1821 error.ParsingFailed, error.FatalError => renderErrorsAndExit(&aro_comp),
1822 error.OutOfMemory => return error.OutOfMemory,1822 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", .{}),
1824 };1824 };
1825 defer tree.deinit(gpa);1825 defer tree.deinit(gpa);
18261826
lib/compiler/objcopy.zig+1-1
...@@ -7,7 +7,7 @@ const Allocator = std.mem.Allocator;...@@ -7,7 +7,7 @@ const Allocator = std.mem.Allocator;
7const File = std.fs.File;7const File = std.fs.File;
8const assert = std.debug.assert;8const assert = std.debug.assert;
99
10const fatal = std.zig.fatal;10const fatal = std.process.fatal;
11const Server = std.zig.Server;11const Server = std.zig.Server;
1212
13pub fn main() !void {13pub fn main() !void {
lib/std/Build.zig+7-314
...@@ -692,6 +692,7 @@ pub fn addOptions(b: *Build) *Step.Options {...@@ -692,6 +692,7 @@ pub fn addOptions(b: *Build) *Step.Options {
692692
693pub const ExecutableOptions = struct {693pub const ExecutableOptions = struct {
694 name: []const u8,694 name: []const u8,
695 root_module: *Module,
695 version: ?std.SemanticVersion = null,696 version: ?std.SemanticVersion = null,
696 linkage: ?std.builtin.LinkMode = null,697 linkage: ?std.builtin.LinkMode = null,
697 max_rss: usize = 0,698 max_rss: usize = 0,
...@@ -704,58 +705,12 @@ pub const ExecutableOptions = struct {...@@ -704,58 +705,12 @@ pub const ExecutableOptions = struct {
704 /// Can be set regardless of target. The `.manifest` file will be ignored705 /// Can be set regardless of target. The `.manifest` file will be ignored
705 /// if the target object format does not support embedded manifests.706 /// if the target object format does not support embedded manifests.
706 win32_manifest: ?LazyPath = null,707 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,
737};708};
738709
739pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {710pub 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 }
743 return .create(b, .{711 return .create(b, .{
744 .name = options.name,712 .name = options.name,
745 .root_module = options.root_module orelse b.createModule(.{713 .root_module = options.root_module,
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 }),
759 .version = options.version,714 .version = options.version,
760 .kind = .exe,715 .kind = .exe,
761 .linkage = options.linkage,716 .linkage = options.linkage,
...@@ -769,62 +724,17 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {...@@ -769,62 +724,17 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {
769724
770pub const ObjectOptions = struct {725pub const ObjectOptions = struct {
771 name: []const u8,726 name: []const u8,
727 root_module: *Module,
772 max_rss: usize = 0,728 max_rss: usize = 0,
773 use_llvm: ?bool = null,729 use_llvm: ?bool = null,
774 use_lld: ?bool = null,730 use_lld: ?bool = null,
775 zig_lib_dir: ?LazyPath = null,731 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,
806};732};
807733
808pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {734pub 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 }
812 return .create(b, .{735 return .create(b, .{
813 .name = options.name,736 .name = options.name,
814 .root_module = options.root_module orelse b.createModule(.{737 .root_module = options.root_module,
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 }),
828 .kind = .obj,738 .kind = .obj,
829 .max_rss = options.max_rss,739 .max_rss = options.max_rss,
830 .use_llvm = options.use_llvm,740 .use_llvm = options.use_llvm,
...@@ -833,153 +743,6 @@ pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {...@@ -833,153 +743,6 @@ pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {
833 });743 });
834}744}
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
983pub const LibraryOptions = struct {746pub const LibraryOptions = struct {
984 linkage: std.builtin.LinkMode = .static,747 linkage: std.builtin.LinkMode = .static,
985 name: []const u8,748 name: []const u8,
...@@ -1014,9 +777,8 @@ pub fn addLibrary(b: *Build, options: LibraryOptions) *Step.Compile {...@@ -1014,9 +777,8 @@ pub fn addLibrary(b: *Build, options: LibraryOptions) *Step.Compile {
1014777
1015pub const TestOptions = struct {778pub const TestOptions = struct {
1016 name: []const u8 = "test",779 name: []const u8 = "test",
780 root_module: *Module,
1017 max_rss: usize = 0,781 max_rss: usize = 0,
1018 /// Deprecated; use `.filters = &.{filter}` instead of `.filter = filter`.
1019 filter: ?[]const u8 = null,
1020 filters: []const []const u8 = &.{},782 filters: []const []const u8 = &.{},
1021 test_runner: ?Step.Compile.TestRunner = null,783 test_runner: ?Step.Compile.TestRunner = null,
1022 use_llvm: ?bool = null,784 use_llvm: ?bool = null,
...@@ -1026,38 +788,6 @@ pub const TestOptions = struct {...@@ -1026,38 +788,6 @@ pub const TestOptions = struct {
1026 /// The object must be linked separately.788 /// The object must be linked separately.
1027 /// Usually used in conjunction with a custom `test_runner`.789 /// Usually used in conjunction with a custom `test_runner`.
1028 emit_object: bool = false,790 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,
1061};791};
1062792
1063/// Creates an executable containing unit tests.793/// Creates an executable containing unit tests.
...@@ -1069,33 +799,12 @@ pub const TestOptions = struct {...@@ -1069,33 +799,12 @@ pub const TestOptions = struct {
1069/// two steps are separated because they are independently configured and799/// two steps are separated because they are independently configured and
1070/// cached.800/// cached.
1071pub fn addTest(b: *Build, options: TestOptions) *Step.Compile {801pub 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 }
1075 return .create(b, .{802 return .create(b, .{
1076 .name = options.name,803 .name = options.name,
1077 .kind = if (options.emit_object) .test_obj else .@"test",804 .kind = if (options.emit_object) .test_obj else .@"test",
1078 .root_module = options.root_module orelse b.createModule(.{805 .root_module = options.root_module,
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 }),
1092 .max_rss = options.max_rss,806 .max_rss = options.max_rss,
1093 .filters = if (options.filter != null and options.filters.len > 0) filters: {807 .filters = b.dupeStrings(options.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),
1099 .test_runner = options.test_runner,808 .test_runner = options.test_runner,
1100 .use_llvm = options.use_llvm,809 .use_llvm = options.use_llvm,
1101 .use_lld = options.use_lld,810 .use_lld = options.use_lld,
...@@ -1114,22 +823,6 @@ pub const AssemblyOptions = struct {...@@ -1114,22 +823,6 @@ pub const AssemblyOptions = struct {
1114 zig_lib_dir: ?LazyPath = null,823 zig_lib_dir: ?LazyPath = null,
1115};824};
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
1133/// This function creates a module and adds it to the package's module set, making826/// This function creates a module and adds it to the package's module set, making
1134/// it available to other packages which depend on this one.827/// it available to other packages which depend on this one.
1135/// `createModule` can be used instead to create a private module.828/// `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" {...@@ -1326,7 +1326,7 @@ test "cache file and then recall it" {
1326 // Wait for file timestamps to tick1326 // Wait for file timestamps to tick
1327 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);1327 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);
1328 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {1328 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {
1329 std.time.sleep(1);1329 std.Thread.sleep(1);
1330 }1330 }
13311331
1332 var digest1: HexDigest = undefined;1332 var digest1: HexDigest = undefined;
...@@ -1389,7 +1389,7 @@ test "check that changing a file makes cache fail" {...@@ -1389,7 +1389,7 @@ test "check that changing a file makes cache fail" {
1389 // Wait for file timestamps to tick1389 // Wait for file timestamps to tick
1390 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);1390 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);
1391 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {1391 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {
1392 std.time.sleep(1);1392 std.Thread.sleep(1);
1393 }1393 }
13941394
1395 var digest1: HexDigest = undefined;1395 var digest1: HexDigest = undefined;
...@@ -1501,7 +1501,7 @@ test "Manifest with files added after initial hash work" {...@@ -1501,7 +1501,7 @@ test "Manifest with files added after initial hash work" {
1501 // Wait for file timestamps to tick1501 // Wait for file timestamps to tick
1502 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);1502 const initial_time = try testGetCurrentFileTimestamp(tmp.dir);
1503 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {1503 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time) {
1504 std.time.sleep(1);1504 std.Thread.sleep(1);
1505 }1505 }
15061506
1507 var digest1: HexDigest = undefined;1507 var digest1: HexDigest = undefined;
...@@ -1551,7 +1551,7 @@ test "Manifest with files added after initial hash work" {...@@ -1551,7 +1551,7 @@ test "Manifest with files added after initial hash work" {
1551 // Wait for file timestamps to tick1551 // Wait for file timestamps to tick
1552 const initial_time2 = try testGetCurrentFileTimestamp(tmp.dir);1552 const initial_time2 = try testGetCurrentFileTimestamp(tmp.dir);
1553 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time2) {1553 while ((try testGetCurrentFileTimestamp(tmp.dir)) == initial_time2) {
1554 std.time.sleep(1);1554 std.Thread.sleep(1);
1555 }1555 }
15561556
1557 {1557 {
lib/std/Build/Step/ConfigHeader.zig+3-6
...@@ -8,9 +8,6 @@ pub const Style = union(enum) {...@@ -8,9 +8,6 @@ pub const Style = union(enum) {
8 /// A configure format supported by autotools that uses `#undef foo` to8 /// A configure format supported by autotools that uses `#undef foo` to
9 /// mark lines that can be substituted with different values.9 /// mark lines that can be substituted with different values.
10 autoconf_undef: std.Build.LazyPath,10 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,
14 /// A configure format supported by autotools that uses `@FOO@` output variables.11 /// A configure format supported by autotools that uses `@FOO@` output variables.
15 autoconf_at: std.Build.LazyPath,12 autoconf_at: std.Build.LazyPath,
16 /// The configure format supported by CMake. It uses `@FOO@`, `${}` and13 /// The configure format supported by CMake. It uses `@FOO@`, `${}` and
...@@ -23,7 +20,7 @@ pub const Style = union(enum) {...@@ -23,7 +20,7 @@ pub const Style = union(enum) {
2320
24 pub fn getPath(style: Style) ?std.Build.LazyPath {21 pub fn getPath(style: Style) ?std.Build.LazyPath {
25 switch (style) {22 switch (style) {
26 .autoconf_undef, .autoconf, .autoconf_at, .cmake => |s| return s,23 .autoconf_undef, .autoconf_at, .cmake => |s| return s,
27 .blank, .nasm => return null,24 .blank, .nasm => return null,
28 }25 }
29 }26 }
...@@ -205,7 +202,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {...@@ -205,7 +202,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
205 const asm_generated_line = "; " ++ header_text ++ "\n";202 const asm_generated_line = "; " ++ header_text ++ "\n";
206203
207 switch (config_header.style) {204 switch (config_header.style) {
208 .autoconf_undef, .autoconf, .autoconf_at => |file_source| {205 .autoconf_undef, .autoconf_at => |file_source| {
209 try bw.writeAll(c_generated_line);206 try bw.writeAll(c_generated_line);
210 const src_path = file_source.getPath2(b, step);207 const src_path = file_source.getPath2(b, step);
211 const contents = std.fs.cwd().readFileAlloc(arena, src_path, config_header.max_bytes) catch |err| {208 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 {...@@ -214,7 +211,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
214 });211 });
215 };212 };
216 switch (config_header.style) {213 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),
218 .autoconf_at => try render_autoconf_at(step, contents, &aw, config_header.values, src_path),215 .autoconf_at => try render_autoconf_at(step, contents, &aw, config_header.values, src_path),
219 else => unreachable,216 else => unreachable,
220 }217 }
lib/std/Build/Step/TranslateC.zig-13
...@@ -63,19 +63,6 @@ pub fn getOutput(translate_c: *TranslateC) std.Build.LazyPath {...@@ -63,19 +63,6 @@ pub fn getOutput(translate_c: *TranslateC) std.Build.LazyPath {
63 return .{ .generated = .{ .file = &translate_c.output_file } };63 return .{ .generated = .{ .file = &translate_c.output_file } };
64}64}
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
79/// Creates a module from the translated source and adds it to the package's66/// Creates a module from the translated source and adds it to the package's
80/// module set making it available to other packages which depend on this one.67/// module set making it available to other packages which depend on this one.
81/// `createModule` can be used instead to create a private module.68/// `createModule` can be used instead to create a private module.
lib/std/Build/Watch.zig+1-1
...@@ -4,7 +4,7 @@ const Watch = @This();...@@ -4,7 +4,7 @@ const Watch = @This();
4const Step = std.Build.Step;4const Step = std.Build.Step;
5const Allocator = std.mem.Allocator;5const Allocator = std.mem.Allocator;
6const assert = std.debug.assert;6const assert = std.debug.assert;
7const fatal = std.zig.fatal;7const fatal = std.process.fatal;
88
9dir_table: DirTable,9dir_table: DirTable,
10os: Os,10os: Os,
lib/std/Thread/Condition.zig+3-3
...@@ -130,7 +130,7 @@ const SingleThreadedImpl = struct {...@@ -130,7 +130,7 @@ const SingleThreadedImpl = struct {
130 unreachable; // deadlock detected130 unreachable; // deadlock detected
131 };131 };
132132
133 std.time.sleep(timeout_ns);133 std.Thread.sleep(timeout_ns);
134 return error.Timeout;134 return error.Timeout;
135 }135 }
136136
...@@ -348,7 +348,7 @@ test "wait and signal" {...@@ -348,7 +348,7 @@ test "wait and signal" {
348 }348 }
349349
350 while (true) {350 while (true) {
351 std.time.sleep(100 * std.time.ns_per_ms);351 std.Thread.sleep(100 * std.time.ns_per_ms);
352352
353 multi_wait.mutex.lock();353 multi_wait.mutex.lock();
354 defer multi_wait.mutex.unlock();354 defer multi_wait.mutex.unlock();
...@@ -405,7 +405,7 @@ test signal {...@@ -405,7 +405,7 @@ test signal {
405 }405 }
406406
407 while (true) {407 while (true) {
408 std.time.sleep(10 * std.time.ns_per_ms);408 std.Thread.sleep(10 * std.time.ns_per_ms);
409409
410 signal_test.mutex.lock();410 signal_test.mutex.lock();
411 defer signal_test.mutex.unlock();411 defer signal_test.mutex.unlock();
lib/std/Thread/Futex.zig+1-1
...@@ -116,7 +116,7 @@ const SingleThreadedImpl = struct {...@@ -116,7 +116,7 @@ const SingleThreadedImpl = struct {
116 unreachable; // deadlock detected116 unreachable; // deadlock detected
117 };117 };
118118
119 std.time.sleep(delay);119 std.Thread.sleep(delay);
120 return error.Timeout;120 return error.Timeout;
121 }121 }
122122
lib/std/Thread/ResetEvent.zig+1-1
...@@ -74,7 +74,7 @@ const SingleThreadedImpl = struct {...@@ -74,7 +74,7 @@ const SingleThreadedImpl = struct {
74 unreachable; // deadlock detected74 unreachable; // deadlock detected
75 };75 };
7676
77 std.time.sleep(timeout_ns);77 std.Thread.sleep(timeout_ns);
78 return error.Timeout;78 return error.Timeout;
79 }79 }
8080
lib/std/ascii.zig-3
...@@ -181,9 +181,6 @@ pub fn isAscii(c: u8) bool {...@@ -181,9 +181,6 @@ pub fn isAscii(c: u8) bool {
181 return c < 128;181 return c < 128;
182}182}
183183
184/// Deprecated: use `isAscii`
185pub const isASCII = isAscii;
186
187/// Uppercases the character and returns it as-is if already uppercase or not a letter.184/// Uppercases the character and returns it as-is if already uppercase or not a letter.
188pub fn toUpper(c: u8) u8 {185pub fn toUpper(c: u8) u8 {
189 const mask = @as(u8, @intFromBool(isLower(c))) << 5;186 const mask = @as(u8, @intFromBool(isLower(c))) << 5;
lib/std/atomic.zig-2
...@@ -10,8 +10,6 @@ pub fn Value(comptime T: type) type {...@@ -10,8 +10,6 @@ pub fn Value(comptime T: type) type {
10 return .{ .raw = value };10 return .{ .raw = value };
11 }11 }
1212
13 pub const fence = @compileError("@fence is deprecated, use other atomics to establish ordering");
14
15 pub inline fn load(self: *const Self, comptime order: AtomicOrder) T {13 pub inline fn load(self: *const Self, comptime order: AtomicOrder) T {
16 return @atomicLoad(T, &self.raw, order);14 return @atomicLoad(T, &self.raw, order);
17 }15 }
lib/std/builtin.zig-55
...@@ -154,9 +154,6 @@ pub const OptimizeMode = enum {...@@ -154,9 +154,6 @@ pub const OptimizeMode = enum {
154 ReleaseSmall,154 ReleaseSmall,
155};155};
156156
157/// Deprecated; use OptimizeMode.
158pub const Mode = OptimizeMode;
159
160/// The calling convention of a function defines how arguments and return values are passed, as well157/// The calling convention of a function defines how arguments and return values are passed, as well
161/// as any other requirements which callers and callees must respect, such as register preservation158/// as any other requirements which callers and callees must respect, such as register preservation
162/// and stack alignment.159/// and stack alignment.
...@@ -185,51 +182,6 @@ pub const CallingConvention = union(enum(u8)) {...@@ -185,51 +182,6 @@ pub const CallingConvention = union(enum(u8)) {
185 else => unreachable,182 else => unreachable,
186 };183 };
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
233 /// The default Zig calling convention when neither `export` nor `inline` is specified.185 /// The default Zig calling convention when neither `export` nor `inline` is specified.
234 /// This calling convention makes no guarantees about stack alignment, registers, etc.186 /// This calling convention makes no guarantees about stack alignment, registers, etc.
235 /// It can only be used within this Zig compilation unit.187 /// It can only be used within this Zig compilation unit.
...@@ -1117,10 +1069,6 @@ pub const TestFn = struct {...@@ -1117,10 +1069,6 @@ pub const TestFn = struct {
1117 func: *const fn () anyerror!void,1069 func: *const fn () anyerror!void,
1118};1070};
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
1124/// This namespace is used by the Zig compiler to emit various kinds of safety1072/// This namespace is used by the Zig compiler to emit various kinds of safety
1125/// panics. These can be overridden by making a public `panic` namespace in the1073/// panics. These can be overridden by making a public `panic` namespace in the
1126/// root source file.1074/// root source file.
...@@ -1136,9 +1084,6 @@ pub const panic: type = p: {...@@ -1136,9 +1084,6 @@ pub const panic: type = p: {
1136 }1084 }
1137 break :p root.panic;1085 break :p root.panic;
1138 }1086 }
1139 if (@hasDecl(root, "Panic")) {
1140 break :p root.Panic; // Deprecated; use `panic` instead.
1141 }
1142 break :p switch (builtin.zig_backend) {1087 break :p switch (builtin.zig_backend) {
1143 .stage2_powerpc,1088 .stage2_powerpc,
1144 .stage2_riscv64,1089 .stage2_riscv64,
lib/std/crypto.zig-18
...@@ -101,7 +101,6 @@ pub const dh = struct {...@@ -101,7 +101,6 @@ pub const dh = struct {
101pub const kem = struct {101pub const kem = struct {
102 pub const kyber_d00 = @import("crypto/ml_kem.zig").d00;102 pub const kyber_d00 = @import("crypto/ml_kem.zig").d00;
103 pub const ml_kem = @import("crypto/ml_kem.zig").nist;103 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");
105};104};
106105
107/// Elliptic-curve arithmetic.106/// Elliptic-curve arithmetic.
...@@ -400,20 +399,3 @@ test secureZero {...@@ -400,20 +399,3 @@ test secureZero {
400399
401 try std.testing.expectEqualSlices(u8, &a, &b);400 try std.testing.expectEqualSlices(u8, &a, &b);
402}401}
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 {...@@ -265,7 +265,7 @@ test classify {
265265
266 // Comparing secret data must be done in constant time. The result266 // Comparing secret data must be done in constant time. The result
267 // is going to be considered as secret as well.267 // 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
270 // If we want to make a conditional jump based on a secret,270 // If we want to make a conditional jump based on a secret,
271 // it has to be declassified.271 // it has to be declassified.
lib/std/debug.zig-4
...@@ -227,10 +227,6 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {...@@ -227,10 +227,6 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {
227 nosuspend bw.print(fmt, args) catch return;227 nosuspend bw.print(fmt, args) catch return;
228}228}
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
234/// TODO multithreaded awareness230/// TODO multithreaded awareness
235var self_debug_info: ?SelfInfo = null;231var self_debug_info: ?SelfInfo = null;
236232
lib/std/fs.zig-10
...@@ -35,8 +35,6 @@ pub const realpathW = posix.realpathW;...@@ -35,8 +35,6 @@ pub const realpathW = posix.realpathW;
35pub const getAppDataDir = @import("fs/get_app_data_dir.zig").getAppDataDir;35pub const getAppDataDir = @import("fs/get_app_data_dir.zig").getAppDataDir;
36pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirError;36pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirError;
3737
38pub const MAX_PATH_BYTES = @compileError("deprecated; renamed to max_path_bytes");
39
40/// The maximum length of a file path that the operating system will accept.38/// The maximum length of a file path that the operating system will accept.
41///39///
42/// Paths, including those returned from file system operations, may be longer40/// Paths, including those returned from file system operations, may be longer
...@@ -90,9 +88,6 @@ pub const max_name_bytes = switch (native_os) {...@@ -90,9 +88,6 @@ pub const max_name_bytes = switch (native_os) {
90 @compileError("NAME_MAX not implemented for " ++ @tagName(native_os)),88 @compileError("NAME_MAX not implemented for " ++ @tagName(native_os)),
91};89};
9290
93/// Deprecated: use `max_name_bytes`
94pub const MAX_NAME_BYTES = max_name_bytes;
95
96pub const base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".*;91pub const base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".*;
9792
98/// Base64 encoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.93/// 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);...@@ -101,11 +96,6 @@ pub const base64_encoder = base64.Base64Encoder.init(base64_alphabet, null);
101/// Base64 decoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.96/// Base64 decoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.
102pub const base64_decoder = base64.Base64Decoder.init(base64_alphabet, null);97pub 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
109/// Same as `Dir.updateFile`, except asserts that both `source_path` and `dest_path`99/// Same as `Dir.updateFile`, except asserts that both `source_path` and `dest_path`
110/// are absolute. See `Dir.updateFile` for a function that operates on both100/// are absolute. See `Dir.updateFile` for a function that operates on both
111/// absolute and relative paths.101/// absolute and relative paths.
lib/std/fs/Dir.zig-5
...@@ -1402,9 +1402,6 @@ pub fn setAsCwd(self: Dir) !void {...@@ -1402,9 +1402,6 @@ pub fn setAsCwd(self: Dir) !void {
1402 try posix.fchdir(self.fd);1402 try posix.fchdir(self.fd);
1403}1403}
14041404
1405/// Deprecated: use `OpenOptions`
1406pub const OpenDirOptions = OpenOptions;
1407
1408pub const OpenOptions = struct {1405pub const OpenOptions = struct {
1409 /// `true` means the opened directory can be used as the `Dir` parameter1406 /// `true` means the opened directory can be used as the `Dir` parameter
1410 /// for functions which operate based on an open directory handle. When `false`,1407 /// 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 {...@@ -2459,8 +2456,6 @@ pub fn writeFile(self: Dir, options: WriteFileOptions) WriteFileError!void {
2459 try file.writeAll(options.data);2456 try file.writeAll(options.data);
2460}2457}
24612458
2462pub const writeFile2 = @compileError("deprecated; renamed to writeFile");
2463
2464pub const AccessError = posix.AccessError;2459pub const AccessError = posix.AccessError;
24652460
2466/// Test accessing `sub_path`.2461/// Test accessing `sub_path`.
lib/std/hash.zig+1-2
...@@ -81,9 +81,8 @@ fn uint16(input: u16) u16 {...@@ -81,9 +81,8 @@ fn uint16(input: u16) u16 {
81 return x;81 return x;
82}82}
8383
84/// DEPRECATED: use std.hash.int()
85/// Source: https://github.com/skeeto/hash-prospector84/// Source: https://github.com/skeeto/hash-prospector
86pub fn uint32(input: u32) u32 {85fn uint32(input: u32) u32 {
87 var x: u32 = input;86 var x: u32 = input;
88 x = (x ^ (x >> 17)) *% 0xed5ad4bb;87 x = (x ^ (x >> 17)) *% 0xed5ad4bb;
89 x = (x ^ (x >> 11)) *% 0xac4c1b51;88 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 {...@@ -100,13 +100,3 @@ pub fn Crc(comptime W: type, comptime algorithm: Algorithm(W)) type {
100 }100 }
101 };101 };
102}102}
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 {...@@ -33,9 +33,6 @@ pub fn readUleb128(comptime T: type, reader: anytype) !T {
33 return @as(T, @truncate(value));33 return @as(T, @truncate(value));
34}34}
3535
36/// Deprecated: use `readUleb128`
37pub const readULEB128 = readUleb128;
38
39/// Write a single unsigned integer as unsigned LEB128 to the given writer.36/// Write a single unsigned integer as unsigned LEB128 to the given writer.
40pub fn writeUleb128(writer: anytype, arg: anytype) !void {37pub fn writeUleb128(writer: anytype, arg: anytype) !void {
41 const Arg = @TypeOf(arg);38 const Arg = @TypeOf(arg);
...@@ -58,9 +55,6 @@ pub fn writeUleb128(writer: anytype, arg: anytype) !void {...@@ -58,9 +55,6 @@ pub fn writeUleb128(writer: anytype, arg: anytype) !void {
58 }55 }
59}56}
6057
61/// Deprecated: use `writeUleb128`
62pub const writeULEB128 = writeUleb128;
63
64/// Read a single signed LEB128 value from the given reader as type T,58/// Read a single signed LEB128 value from the given reader as type T,
65/// or error.Overflow if the value cannot fit.59/// or error.Overflow if the value cannot fit.
66pub fn readIleb128(comptime T: type, reader: anytype) !T {60pub fn readIleb128(comptime T: type, reader: anytype) !T {
...@@ -119,9 +113,6 @@ pub fn readIleb128(comptime T: type, reader: anytype) !T {...@@ -119,9 +113,6 @@ pub fn readIleb128(comptime T: type, reader: anytype) !T {
119 return @as(T, @truncate(result));113 return @as(T, @truncate(result));
120}114}
121115
122/// Deprecated: use `readIleb128`
123pub const readILEB128 = readIleb128;
124
125/// Write a single signed integer as signed LEB128 to the given writer.116/// Write a single signed integer as signed LEB128 to the given writer.
126pub fn writeIleb128(writer: anytype, arg: anytype) !void {117pub fn writeIleb128(writer: anytype, arg: anytype) !void {
127 const Arg = @TypeOf(arg);118 const Arg = @TypeOf(arg);
...@@ -176,9 +167,6 @@ pub fn writeUnsignedExtended(slice: []u8, arg: anytype) void {...@@ -176,9 +167,6 @@ pub fn writeUnsignedExtended(slice: []u8, arg: anytype) void {
176 slice[slice.len - 1] = @as(u7, @intCast(value));167 slice[slice.len - 1] = @as(u7, @intCast(value));
177}168}
178169
179/// Deprecated: use `writeIleb128`
180pub const writeILEB128 = writeIleb128;
181
182test writeUnsignedFixed {170test writeUnsignedFixed {
183 {171 {
184 var buf: [4]u8 = undefined;172 var buf: [4]u8 = undefined;
lib/std/math/big/int.zig-6
...@@ -2222,9 +2222,6 @@ pub const Const = struct {...@@ -2222,9 +2222,6 @@ pub const Const = struct {
2222 TargetTooSmall,2222 TargetTooSmall,
2223 };2223 };
22242224
2225 /// Deprecated; use `toInt`.
2226 pub const to = toInt;
2227
2228 /// Convert `self` to `Int`.2225 /// Convert `self` to `Int`.
2229 ///2226 ///
2230 /// Returns an error if self cannot be narrowed into the requested type without truncation.2227 /// Returns an error if self cannot be narrowed into the requested type without truncation.
...@@ -2855,9 +2852,6 @@ pub const Managed = struct {...@@ -2855,9 +2852,6 @@ pub const Managed = struct {
28552852
2856 pub const ConvertError = Const.ConvertError;2853 pub const ConvertError = Const.ConvertError;
28572854
2858 /// Deprecated; use `toInt`.
2859 pub const to = toInt;
2860
2861 /// Convert `self` to `Int`.2855 /// Convert `self` to `Int`.
2862 ///2856 ///
2863 /// Returns an error if self cannot be narrowed into the requested type without truncation.2857 /// 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" {...@@ -688,7 +688,7 @@ test "string set base 36" {
688 defer a.deinit();688 defer a.deinit();
689689
690 try a.setString(36, "fifvthrv1mzt79ez9");690 try a.setString(36, "fifvthrv1mzt79ez9");
691 try testing.expectEqual(123456789123456789123456789, try a.to(u128));691 try testing.expectEqual(123456789123456789123456789, try a.toInt(u128));
692}692}
693693
694test "string set bad char error" {694test "string set bad char error" {
lib/std/mem.zig-6
...@@ -2258,8 +2258,6 @@ test byteSwapAllFields {...@@ -2258,8 +2258,6 @@ test byteSwapAllFields {
2258 }, k);2258 }, k);
2259}2259}
22602260
2261pub const tokenize = @compileError("deprecated; use tokenizeAny, tokenizeSequence, or tokenizeScalar");
2262
2263/// Returns an iterator that iterates over the slices of `buffer` that are not2261/// Returns an iterator that iterates over the slices of `buffer` that are not
2264/// any of the items in `delimiters`.2262/// any of the items in `delimiters`.
2265///2263///
...@@ -2458,8 +2456,6 @@ test "tokenize (reset)" {...@@ -2458,8 +2456,6 @@ test "tokenize (reset)" {
2458 }2456 }
2459}2457}
24602458
2461pub const split = @compileError("deprecated; use splitSequence, splitAny, or splitScalar");
2462
2463/// Returns an iterator that iterates over the slices of `buffer` that2459/// Returns an iterator that iterates over the slices of `buffer` that
2464/// are separated by the byte sequence in `delimiter`.2460/// are separated by the byte sequence in `delimiter`.
2465///2461///
...@@ -2659,8 +2655,6 @@ test "split (reset)" {...@@ -2659,8 +2655,6 @@ test "split (reset)" {
2659 }2655 }
2660}2656}
26612657
2662pub const splitBackwards = @compileError("deprecated; use splitBackwardsSequence, splitBackwardsAny, or splitBackwardsScalar");
2663
2664/// Returns an iterator that iterates backwards over the slices of `buffer` that2658/// Returns an iterator that iterates backwards over the slices of `buffer` that
2665/// are separated by the sequence in `delimiter`.2659/// are separated by the sequence in `delimiter`.
2666///2660///
lib/std/meta.zig-23
...@@ -418,29 +418,6 @@ test fieldInfo {...@@ -418,29 +418,6 @@ test fieldInfo {
418 try testing.expect(comptime uf.type == u8);418 try testing.expect(comptime uf.type == u8);
419}419}
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
444pub fn fieldNames(comptime T: type) *const [fields(T).len][:0]const u8 {421pub fn fieldNames(comptime T: type) *const [fields(T).len][:0]const u8 {
445 return comptime blk: {422 return comptime blk: {
446 const fieldInfos = fields(T);423 const fieldInfos = fields(T);
lib/std/net.zig+1-3
...@@ -214,8 +214,6 @@ pub const Address = extern union {...@@ -214,8 +214,6 @@ pub const Address = extern union {
214 /// Sets SO_REUSEADDR and SO_REUSEPORT on POSIX.214 /// Sets SO_REUSEADDR and SO_REUSEPORT on POSIX.
215 /// Sets SO_REUSEADDR on Windows, which is roughly equivalent.215 /// Sets SO_REUSEADDR on Windows, which is roughly equivalent.
216 reuse_address: bool = false,216 reuse_address: bool = false,
217 /// Deprecated. Does the same thing as reuse_address.
218 reuse_port: bool = false,
219 force_nonblocking: bool = false,217 force_nonblocking: bool = false,
220 };218 };
221219
...@@ -232,7 +230,7 @@ pub const Address = extern union {...@@ -232,7 +230,7 @@ pub const Address = extern union {
232 };230 };
233 errdefer s.stream.close();231 errdefer s.stream.close();
234232
235 if (options.reuse_address or options.reuse_port) {233 if (options.reuse_address) {
236 try posix.setsockopt(234 try posix.setsockopt(
237 sockfd,235 sockfd,
238 posix.SOL.SOCKET,236 posix.SOL.SOCKET,
lib/std/net/test.zig+4-4
...@@ -232,10 +232,10 @@ test "listen on an in use port" {...@@ -232,10 +232,10 @@ test "listen on an in use port" {
232232
233 const localhost = try net.Address.parseIp("127.0.0.1", 0);233 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 });
236 defer server1.deinit();236 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 });
239 defer server2.deinit();239 defer server2.deinit();
240}240}
241241
...@@ -315,7 +315,7 @@ test "listen on a unix socket, send bytes, receive bytes" {...@@ -315,7 +315,7 @@ test "listen on a unix socket, send bytes, receive bytes" {
315 try testing.expectEqualSlices(u8, "Hello world!", buf[0..n]);315 try testing.expectEqualSlices(u8, "Hello world!", buf[0..n]);
316}316}
317317
318test "listen on a unix socket with reuse_port option" {318test "listen on a unix socket with reuse_address option" {
319 if (!net.has_unix_sockets) return error.SkipZigTest;319 if (!net.has_unix_sockets) return error.SkipZigTest;
320 // Windows doesn't implement reuse port option.320 // Windows doesn't implement reuse port option.
321 if (builtin.os.tag == .windows) return error.SkipZigTest;321 if (builtin.os.tag == .windows) return error.SkipZigTest;
...@@ -326,7 +326,7 @@ test "listen on a unix socket with reuse_port option" {...@@ -326,7 +326,7 @@ test "listen on a unix socket with reuse_port option" {
326 const socket_addr = try net.Address.initUnix(socket_path);326 const socket_addr = try net.Address.initUnix(socket_path);
327 defer std.fs.cwd().deleteFile(socket_path) catch {};327 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 });
330 server.deinit();330 server.deinit();
331}331}
332332
lib/std/os/windows.zig+1-4
...@@ -146,7 +146,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN...@@ -146,7 +146,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN
146 // call has failed. There is not really a sane way to handle146 // call has failed. There is not really a sane way to handle
147 // this other than retrying the creation after the OS finishes147 // this other than retrying the creation after the OS finishes
148 // the deletion.148 // the deletion.
149 std.time.sleep(std.time.ns_per_ms);149 std.Thread.sleep(std.time.ns_per_ms);
150 continue;150 continue;
151 },151 },
152 .VIRUS_INFECTED, .VIRUS_DELETED => return error.AntivirusInterference,152 .VIRUS_INFECTED, .VIRUS_DELETED => return error.AntivirusInterference,
...@@ -2848,9 +2848,6 @@ pub const STD_OUTPUT_HANDLE = maxInt(DWORD) - 11 + 1;...@@ -2848,9 +2848,6 @@ pub const STD_OUTPUT_HANDLE = maxInt(DWORD) - 11 + 1;
2848/// The standard error device. Initially, this is the active console screen buffer, CONOUT$.2848/// The standard error device. Initially, this is the active console screen buffer, CONOUT$.
2849pub const STD_ERROR_HANDLE = maxInt(DWORD) - 12 + 1;2849pub 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
2854pub const BOOL = c_int;2851pub const BOOL = c_int;
2855pub const BOOLEAN = BYTE;2852pub const BOOLEAN = BYTE;
2856pub const BYTE = u8;2853pub const BYTE = u8;
lib/std/posix/test.zig+1-1
...@@ -1161,7 +1161,7 @@ test "POSIX file locking with fcntl" {...@@ -1161,7 +1161,7 @@ test "POSIX file locking with fcntl" {
1161 posix.exit(0);1161 posix.exit(0);
1162 } else {1162 } else {
1163 // parent waits for child to get shared lock:1163 // 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);
1165 // parent expects deadlock when attempting to upgrade the shared lock to exclusive:1165 // parent expects deadlock when attempting to upgrade the shared lock to exclusive:
1166 struct_flock.start = 1;1166 struct_flock.start = 1;
1167 struct_flock.type = posix.F.WRLCK;1167 struct_flock.type = posix.F.WRLCK;
lib/std/time.zig-3
...@@ -8,9 +8,6 @@ const posix = std.posix;...@@ -8,9 +8,6 @@ const posix = std.posix;
88
9pub const epoch = @import("time/epoch.zig");9pub const epoch = @import("time/epoch.zig");
1010
11/// Deprecated: moved to std.Thread.sleep
12pub const sleep = std.Thread.sleep;
13
14/// Get a calendar timestamp, in seconds, relative to UTC 1970-01-01.11/// Get a calendar timestamp, in seconds, relative to UTC 1970-01-01.
15/// Precision of timing depends on the hardware and operating system.12/// Precision of timing depends on the hardware and operating system.
16/// The return value is signed because it is possible to have a date that is13/// 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)...@@ -972,8 +972,6 @@ pub fn utf16LeToUtf8ArrayList(result: *std.ArrayList(u8), utf16le: []const u16)
972 return utf16LeToUtf8ArrayListImpl(result, utf16le, .cannot_encode_surrogate_half);972 return utf16LeToUtf8ArrayListImpl(result, utf16le, .cannot_encode_surrogate_half);
973}973}
974974
975pub const utf16leToUtf8Alloc = @compileError("deprecated; renamed to utf16LeToUtf8Alloc");
976
977/// Caller must free returned memory.975/// Caller must free returned memory.
978pub fn utf16LeToUtf8Alloc(allocator: mem.Allocator, utf16le: []const u16) Utf16LeToUtf8AllocError![]u8 {976pub fn utf16LeToUtf8Alloc(allocator: mem.Allocator, utf16le: []const u16) Utf16LeToUtf8AllocError![]u8 {
979 // optimistically guess that it will all be ascii.977 // optimistically guess that it will all be ascii.
...@@ -984,8 +982,6 @@ pub fn utf16LeToUtf8Alloc(allocator: mem.Allocator, utf16le: []const u16) Utf16L...@@ -984,8 +982,6 @@ pub fn utf16LeToUtf8Alloc(allocator: mem.Allocator, utf16le: []const u16) Utf16L
984 return result.toOwnedSlice();982 return result.toOwnedSlice();
985}983}
986984
987pub const utf16leToUtf8AllocZ = @compileError("deprecated; renamed to utf16LeToUtf8AllocZ");
988
989/// Caller must free returned memory.985/// Caller must free returned memory.
990pub fn utf16LeToUtf8AllocZ(allocator: mem.Allocator, utf16le: []const u16) Utf16LeToUtf8AllocError![:0]u8 {986pub fn utf16LeToUtf8AllocZ(allocator: mem.Allocator, utf16le: []const u16) Utf16LeToUtf8AllocError![:0]u8 {
991 // optimistically guess that it will all be ascii (and allocate space for the null terminator)987 // 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...@@ -1054,8 +1050,6 @@ fn utf16LeToUtf8Impl(utf8: []u8, utf16le: []const u16, comptime surrogates: Surr
1054 return dest_index;1050 return dest_index;
1055}1051}
10561052
1057pub const utf16leToUtf8 = @compileError("deprecated; renamed to utf16LeToUtf8");
1058
1059pub fn utf16LeToUtf8(utf8: []u8, utf16le: []const u16) Utf16LeToUtf8Error!usize {1053pub fn utf16LeToUtf8(utf8: []u8, utf16le: []const u16) Utf16LeToUtf8Error!usize {
1060 return utf16LeToUtf8Impl(utf8, utf16le, .cannot_encode_surrogate_half);1054 return utf16LeToUtf8Impl(utf8, utf16le, .cannot_encode_surrogate_half);
1061}1055}
...@@ -1175,8 +1169,6 @@ pub fn utf8ToUtf16LeAlloc(allocator: mem.Allocator, utf8: []const u8) error{ Inv...@@ -1175,8 +1169,6 @@ pub fn utf8ToUtf16LeAlloc(allocator: mem.Allocator, utf8: []const u8) error{ Inv
1175 return result.toOwnedSlice();1169 return result.toOwnedSlice();
1176}1170}
11771171
1178pub const utf8ToUtf16LeWithNull = @compileError("deprecated; renamed to utf8ToUtf16LeAllocZ");
1179
1180pub fn utf8ToUtf16LeAllocZ(allocator: mem.Allocator, utf8: []const u8) error{ InvalidUtf8, OutOfMemory }![:0]u16 {1172pub fn utf8ToUtf16LeAllocZ(allocator: mem.Allocator, utf8: []const u8) error{ InvalidUtf8, OutOfMemory }![:0]u16 {
1181 // optimistically guess that it will not require surrogate pairs1173 // optimistically guess that it will not require surrogate pairs
1182 var result = try std.ArrayList(u16).initCapacity(allocator, utf8.len + 1);1174 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...@@ -1487,8 +1479,6 @@ fn formatUtf16Le(utf16le: []const u16, writer: *std.io.Writer) std.io.Writer.Err
1487 try writer.writeAll(buf[0..u8len]);1479 try writer.writeAll(buf[0..u8len]);
1488}1480}
14891481
1490pub const fmtUtf16le = @compileError("deprecated; renamed to fmtUtf16Le");
1491
1492/// Return a Formatter for a (potentially ill-formed) UTF-16 LE string,1482/// Return a Formatter for a (potentially ill-formed) UTF-16 LE string,
1493/// which will be converted to UTF-8 during formatting.1483/// which will be converted to UTF-8 during formatting.
1494/// Unpaired surrogates are replaced by the replacement character (U+FFFD).1484/// 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:...@@ -200,18 +200,6 @@ pub fn nonSimdCall3(func: fn (usize, usize, usize, usize) usize, a1: usize, a2:
200 return doClientRequestExpr(0, .ClientCall3, @intFromPtr(func), a1, a2, a3, 0);200 return doClientRequestExpr(0, .ClientCall3, @intFromPtr(func), a1, a2, a3, 0);
201}201}
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
215/// Counts the number of errors that have been recorded by a tool. Nb:203/// Counts the number of errors that have been recorded by a tool. Nb:
216/// the tool must record the errors with VG_(maybe_record_error)() or204/// the tool must record the errors with VG_(maybe_record_error)() or
217/// VG_(unique_error)() for them to be counted.205/// VG_(unique_error)() for them to be counted.
lib/std/valgrind/callgrind.zig-2
...@@ -10,8 +10,6 @@ pub const ClientRequest = enum(usize) {...@@ -10,8 +10,6 @@ pub const ClientRequest = enum(usize) {
10 StopInstrumentation,10 StopInstrumentation,
11};11};
1212
13pub const CallgrindClientRequest = @compileError("std.valgrind.callgrind.CallgrindClientRequest renamed to std.valgrind.callgrind.ClientRequest");
14
15fn doClientRequestExpr(default: usize, request: ClientRequest, a1: usize, a2: usize, a3: usize, a4: usize, a5: usize) usize {13fn doClientRequestExpr(default: usize, request: ClientRequest, a1: usize, a2: usize, a3: usize, a4: usize, a5: usize) usize {
16 return valgrind.doClientRequest(default, @as(usize, @intCast(@intFromEnum(request))), a1, a2, a3, a4, a5);14 return valgrind.doClientRequest(default, @as(usize, @intCast(@intFromEnum(request))), a1, a2, a3, a4, a5);
17}15}
lib/std/valgrind/memcheck.zig-2
...@@ -20,8 +20,6 @@ pub const ClientRequest = enum(usize) {...@@ -20,8 +20,6 @@ pub const ClientRequest = enum(usize) {
20 DisableAddrErrorReportingInRange,20 DisableAddrErrorReportingInRange,
21};21};
2222
23pub const MemCheckClientRequest = @compileError("std.valgrind.memcheck.MemCheckClientRequest renamed to std.valgrind.memcheck.ClientRequest");
24
25fn doClientRequestExpr(default: usize, request: ClientRequest, a1: usize, a2: usize, a3: usize, a4: usize, a5: usize) usize {23fn doClientRequestExpr(default: usize, request: ClientRequest, a1: usize, a2: usize, a3: usize, a4: usize, a5: usize) usize {
26 return valgrind.doClientRequest(default, @as(usize, @intCast(@intFromEnum(request))), a1, a2, a3, a4, a5);24 return valgrind.doClientRequest(default, @as(usize, @intCast(@intFromEnum(request))), a1, a2, a3, a4, a5);
27}25}
lib/std/zig.zig+6-10
...@@ -17,7 +17,6 @@ pub const Zir = @import("zig/Zir.zig");...@@ -17,7 +17,6 @@ pub const Zir = @import("zig/Zir.zig");
17pub const Zoir = @import("zig/Zoir.zig");17pub const Zoir = @import("zig/Zoir.zig");
18pub const ZonGen = @import("zig/ZonGen.zig");18pub const ZonGen = @import("zig/ZonGen.zig");
19pub const system = @import("zig/system.zig");19pub const system = @import("zig/system.zig");
20pub const CrossTarget = @compileError("deprecated; use std.Target.Query");
21pub const BuiltinFn = @import("zig/BuiltinFn.zig");20pub const BuiltinFn = @import("zig/BuiltinFn.zig");
22pub const AstRlAnnotate = @import("zig/AstRlAnnotate.zig");21pub const AstRlAnnotate = @import("zig/AstRlAnnotate.zig");
23pub const LibCInstallation = @import("zig/LibCInstallation.zig");22pub const LibCInstallation = @import("zig/LibCInstallation.zig");
...@@ -604,7 +603,7 @@ pub fn putAstErrorsIntoBundle(...@@ -604,7 +603,7 @@ pub fn putAstErrorsIntoBundle(
604603
605pub fn resolveTargetQueryOrFatal(target_query: std.Target.Query) std.Target {604pub fn resolveTargetQueryOrFatal(target_query: std.Target.Query) std.Target {
606 return std.zig.system.resolveTargetQuery(target_query) catch |err|605 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)});
608}607}
609608
610pub fn parseTargetQueryOrReportFatalError(609pub fn parseTargetQueryOrReportFatalError(
...@@ -628,7 +627,7 @@ pub fn parseTargetQueryOrReportFatalError(...@@ -628,7 +627,7 @@ pub fn parseTargetQueryOrReportFatalError(
628 @tagName(diags.arch.?), help_text.items,627 @tagName(diags.arch.?), help_text.items,
629 });628 });
630 }629 }
631 fatal("unknown CPU: '{s}'", .{diags.cpu_name.?});630 std.process.fatal("unknown CPU: '{s}'", .{diags.cpu_name.?});
632 },631 },
633 error.UnknownCpuFeature => {632 error.UnknownCpuFeature => {
634 help: {633 help: {
...@@ -641,7 +640,7 @@ pub fn parseTargetQueryOrReportFatalError(...@@ -641,7 +640,7 @@ pub fn parseTargetQueryOrReportFatalError(
641 @tagName(diags.arch.?), help_text.items,640 @tagName(diags.arch.?), help_text.items,
642 });641 });
643 }642 }
644 fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});643 std.process.fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});
645 },644 },
646 error.UnknownObjectFormat => {645 error.UnknownObjectFormat => {
647 help: {646 help: {
...@@ -652,7 +651,7 @@ pub fn parseTargetQueryOrReportFatalError(...@@ -652,7 +651,7 @@ pub fn parseTargetQueryOrReportFatalError(
652 }651 }
653 std.log.info("available object formats:\n{s}", .{help_text.items});652 std.log.info("available object formats:\n{s}", .{help_text.items});
654 }653 }
655 fatal("unknown object format: '{s}'", .{opts.object_format.?});654 std.process.fatal("unknown object format: '{s}'", .{opts.object_format.?});
656 },655 },
657 error.UnknownArchitecture => {656 error.UnknownArchitecture => {
658 help: {657 help: {
...@@ -663,17 +662,14 @@ pub fn parseTargetQueryOrReportFatalError(...@@ -663,17 +662,14 @@ pub fn parseTargetQueryOrReportFatalError(
663 }662 }
664 std.log.info("available architectures:\n{s} native\n", .{help_text.items});663 std.log.info("available architectures:\n{s} native\n", .{help_text.items});
665 }664 }
666 fatal("unknown architecture: '{s}'", .{diags.unknown_architecture_name.?});665 std.process.fatal("unknown architecture: '{s}'", .{diags.unknown_architecture_name.?});
667 },666 },
668 else => |e| fatal("unable to parse target query '{s}': {s}", .{667 else => |e| std.process.fatal("unable to parse target query '{s}': {s}", .{
669 opts.arch_os_abi, @errorName(e),668 opts.arch_os_abi, @errorName(e),
670 }),669 }),
671 };670 };
672}671}
673672
674/// Deprecated; see `std.process.fatal`.
675pub const fatal = std.process.fatal;
676
677/// Collects all the environment variables that Zig could possibly inspect, so673/// Collects all the environment variables that Zig could possibly inspect, so
678/// that we can do reflection on this and print them with `zig env`.674/// that we can do reflection on this and print them with `zig env`.
679pub const EnvVar = enum {675pub const EnvVar = enum {
lib/std/zig/c_translation.zig-3
...@@ -254,9 +254,6 @@ test "sizeof" {...@@ -254,9 +254,6 @@ test "sizeof" {
254254
255pub const CIntLiteralBase = enum { decimal, octal, hex };255pub const CIntLiteralBase = enum { decimal, octal, hex };
256256
257/// Deprecated: use `CIntLiteralBase`
258pub const CIntLiteralRadix = CIntLiteralBase;
259
260fn PromoteIntLiteralReturnType(comptime SuffixType: type, comptime number: comptime_int, comptime base: CIntLiteralBase) type {257fn PromoteIntLiteralReturnType(comptime SuffixType: type, comptime number: comptime_int, comptime base: CIntLiteralBase) type {
261 const signed_decimal = [_]type{ c_int, c_long, c_longlong, c_ulonglong };258 const signed_decimal = [_]type{ c_int, c_long, c_longlong, c_ulonglong };
262 const signed_oct_hex = [_]type{ c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong };259 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(...@@ -10638,7 +10638,7 @@ fn fnTypeAssumeCapacity(
10638 const Adapter = struct {10638 const Adapter = struct {
10639 builder: *const Builder,10639 builder: *const Builder,
10640 pub fn hash(_: @This(), key: Key) u32 {10640 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)));
10642 hasher.update(std.mem.asBytes(&key.ret));10642 hasher.update(std.mem.asBytes(&key.ret));
10643 hasher.update(std.mem.sliceAsBytes(key.params));10643 hasher.update(std.mem.sliceAsBytes(key.params));
10644 return @truncate(hasher.final());10644 return @truncate(hasher.final());
...@@ -10698,7 +10698,7 @@ fn vectorTypeAssumeCapacity(...@@ -10698,7 +10698,7 @@ fn vectorTypeAssumeCapacity(
10698 builder: *const Builder,10698 builder: *const Builder,
10699 pub fn hash(_: @This(), key: Type.Vector) u32 {10699 pub fn hash(_: @This(), key: Type.Vector) u32 {
10700 return @truncate(std.hash.Wyhash.hash(10700 return @truncate(std.hash.Wyhash.hash(
10701 comptime std.hash.uint32(@intFromEnum(tag)),10701 comptime std.hash.int(@intFromEnum(tag)),
10702 std.mem.asBytes(&key),10702 std.mem.asBytes(&key),
10703 ));10703 ));
10704 }10704 }
...@@ -10727,7 +10727,7 @@ fn arrayTypeAssumeCapacity(self: *Builder, len: u64, child: Type) Type {...@@ -10727,7 +10727,7 @@ fn arrayTypeAssumeCapacity(self: *Builder, len: u64, child: Type) Type {
10727 builder: *const Builder,10727 builder: *const Builder,
10728 pub fn hash(_: @This(), key: Type.Vector) u32 {10728 pub fn hash(_: @This(), key: Type.Vector) u32 {
10729 return @truncate(std.hash.Wyhash.hash(10729 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)),
10731 std.mem.asBytes(&key),10731 std.mem.asBytes(&key),
10732 ));10732 ));
10733 }10733 }
...@@ -10753,7 +10753,7 @@ fn arrayTypeAssumeCapacity(self: *Builder, len: u64, child: Type) Type {...@@ -10753,7 +10753,7 @@ fn arrayTypeAssumeCapacity(self: *Builder, len: u64, child: Type) Type {
10753 builder: *const Builder,10753 builder: *const Builder,
10754 pub fn hash(_: @This(), key: Type.Array) u32 {10754 pub fn hash(_: @This(), key: Type.Array) u32 {
10755 return @truncate(std.hash.Wyhash.hash(10755 return @truncate(std.hash.Wyhash.hash(
10756 comptime std.hash.uint32(@intFromEnum(Type.Tag.array)),10756 comptime std.hash.int(@intFromEnum(Type.Tag.array)),
10757 std.mem.asBytes(&key),10757 std.mem.asBytes(&key),
10758 ));10758 ));
10759 }10759 }
...@@ -10794,7 +10794,7 @@ fn structTypeAssumeCapacity(...@@ -10794,7 +10794,7 @@ fn structTypeAssumeCapacity(
10794 builder: *const Builder,10794 builder: *const Builder,
10795 pub fn hash(_: @This(), key: []const Type) u32 {10795 pub fn hash(_: @This(), key: []const Type) u32 {
10796 return @truncate(std.hash.Wyhash.hash(10796 return @truncate(std.hash.Wyhash.hash(
10797 comptime std.hash.uint32(@intFromEnum(tag)),10797 comptime std.hash.int(@intFromEnum(tag)),
10798 std.mem.sliceAsBytes(key),10798 std.mem.sliceAsBytes(key),
10799 ));10799 ));
10800 }10800 }
...@@ -10826,7 +10826,7 @@ fn opaqueTypeAssumeCapacity(self: *Builder, name: String) Type {...@@ -10826,7 +10826,7 @@ fn opaqueTypeAssumeCapacity(self: *Builder, name: String) Type {
10826 builder: *const Builder,10826 builder: *const Builder,
10827 pub fn hash(_: @This(), key: String) u32 {10827 pub fn hash(_: @This(), key: String) u32 {
10828 return @truncate(std.hash.Wyhash.hash(10828 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)),
10830 std.mem.asBytes(&key),10830 std.mem.asBytes(&key),
10831 ));10831 ));
10832 }10832 }
...@@ -10887,7 +10887,7 @@ fn getOrPutTypeNoExtraAssumeCapacity(self: *Builder, item: Type.Item) struct { n...@@ -10887,7 +10887,7 @@ fn getOrPutTypeNoExtraAssumeCapacity(self: *Builder, item: Type.Item) struct { n
10887 builder: *const Builder,10887 builder: *const Builder,
10888 pub fn hash(_: @This(), key: Type.Item) u32 {10888 pub fn hash(_: @This(), key: Type.Item) u32 {
10889 return @truncate(std.hash.Wyhash.hash(10889 return @truncate(std.hash.Wyhash.hash(
10890 comptime std.hash.uint32(@intFromEnum(Type.Tag.simple)),10890 comptime std.hash.int(@intFromEnum(Type.Tag.simple)),
10891 std.mem.asBytes(&key),10891 std.mem.asBytes(&key),
10892 ));10892 ));
10893 }10893 }
...@@ -11021,7 +11021,7 @@ fn bigIntConstAssumeCapacity(...@@ -11021,7 +11021,7 @@ fn bigIntConstAssumeCapacity(
11021 const Adapter = struct {11021 const Adapter = struct {
11022 builder: *const Builder,11022 builder: *const Builder,
11023 pub fn hash(_: @This(), key: Key) u32 {11023 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)));
11025 hasher.update(std.mem.asBytes(&key.type));11025 hasher.update(std.mem.asBytes(&key.type));
11026 hasher.update(std.mem.sliceAsBytes(key.limbs));11026 hasher.update(std.mem.sliceAsBytes(key.limbs));
11027 return @truncate(hasher.final());11027 return @truncate(hasher.final());
...@@ -11084,7 +11084,7 @@ fn doubleConstAssumeCapacity(self: *Builder, val: f64) Constant {...@@ -11084,7 +11084,7 @@ fn doubleConstAssumeCapacity(self: *Builder, val: f64) Constant {
11084 builder: *const Builder,11084 builder: *const Builder,
11085 pub fn hash(_: @This(), key: f64) u32 {11085 pub fn hash(_: @This(), key: f64) u32 {
11086 return @truncate(std.hash.Wyhash.hash(11086 return @truncate(std.hash.Wyhash.hash(
11087 comptime std.hash.uint32(@intFromEnum(Constant.Tag.double)),11087 comptime std.hash.int(@intFromEnum(Constant.Tag.double)),
11088 std.mem.asBytes(&key),11088 std.mem.asBytes(&key),
11089 ));11089 ));
11090 }11090 }
...@@ -11115,7 +11115,7 @@ fn fp128ConstAssumeCapacity(self: *Builder, val: f128) Constant {...@@ -11115,7 +11115,7 @@ fn fp128ConstAssumeCapacity(self: *Builder, val: f128) Constant {
11115 builder: *const Builder,11115 builder: *const Builder,
11116 pub fn hash(_: @This(), key: f128) u32 {11116 pub fn hash(_: @This(), key: f128) u32 {
11117 return @truncate(std.hash.Wyhash.hash(11117 return @truncate(std.hash.Wyhash.hash(
11118 comptime std.hash.uint32(@intFromEnum(Constant.Tag.fp128)),11118 comptime std.hash.int(@intFromEnum(Constant.Tag.fp128)),
11119 std.mem.asBytes(&key),11119 std.mem.asBytes(&key),
11120 ));11120 ));
11121 }11121 }
...@@ -11149,7 +11149,7 @@ fn x86_fp80ConstAssumeCapacity(self: *Builder, val: f80) Constant {...@@ -11149,7 +11149,7 @@ fn x86_fp80ConstAssumeCapacity(self: *Builder, val: f80) Constant {
11149 builder: *const Builder,11149 builder: *const Builder,
11150 pub fn hash(_: @This(), key: f80) u32 {11150 pub fn hash(_: @This(), key: f80) u32 {
11151 return @truncate(std.hash.Wyhash.hash(11151 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)),
11153 std.mem.asBytes(&key)[0..10],11153 std.mem.asBytes(&key)[0..10],
11154 ));11154 ));
11155 }11155 }
...@@ -11182,7 +11182,7 @@ fn ppc_fp128ConstAssumeCapacity(self: *Builder, val: [2]f64) Constant {...@@ -11182,7 +11182,7 @@ fn ppc_fp128ConstAssumeCapacity(self: *Builder, val: [2]f64) Constant {
11182 builder: *const Builder,11182 builder: *const Builder,
11183 pub fn hash(_: @This(), key: [2]f64) u32 {11183 pub fn hash(_: @This(), key: [2]f64) u32 {
11184 return @truncate(std.hash.Wyhash.hash(11184 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)),
11186 std.mem.asBytes(&key),11186 std.mem.asBytes(&key),
11187 ));11187 ));
11188 }11188 }
...@@ -11317,7 +11317,7 @@ fn splatConstAssumeCapacity(self: *Builder, ty: Type, val: Constant) Constant {...@@ -11317,7 +11317,7 @@ fn splatConstAssumeCapacity(self: *Builder, ty: Type, val: Constant) Constant {
11317 builder: *const Builder,11317 builder: *const Builder,
11318 pub fn hash(_: @This(), key: Constant.Splat) u32 {11318 pub fn hash(_: @This(), key: Constant.Splat) u32 {
11319 return @truncate(std.hash.Wyhash.hash(11319 return @truncate(std.hash.Wyhash.hash(
11320 comptime std.hash.uint32(@intFromEnum(Constant.Tag.splat)),11320 comptime std.hash.int(@intFromEnum(Constant.Tag.splat)),
11321 std.mem.asBytes(&key),11321 std.mem.asBytes(&key),
11322 ));11322 ));
11323 }11323 }
...@@ -11420,7 +11420,7 @@ fn blockAddrConstAssumeCapacity(...@@ -11420,7 +11420,7 @@ fn blockAddrConstAssumeCapacity(
11420 builder: *const Builder,11420 builder: *const Builder,
11421 pub fn hash(_: @This(), key: Constant.BlockAddress) u32 {11421 pub fn hash(_: @This(), key: Constant.BlockAddress) u32 {
11422 return @truncate(std.hash.Wyhash.hash(11422 return @truncate(std.hash.Wyhash.hash(
11423 comptime std.hash.uint32(@intFromEnum(Constant.Tag.blockaddress)),11423 comptime std.hash.int(@intFromEnum(Constant.Tag.blockaddress)),
11424 std.mem.asBytes(&key),11424 std.mem.asBytes(&key),
11425 ));11425 ));
11426 }11426 }
...@@ -11546,7 +11546,7 @@ fn castConstAssumeCapacity(self: *Builder, tag: Constant.Tag, val: Constant, ty:...@@ -11546,7 +11546,7 @@ fn castConstAssumeCapacity(self: *Builder, tag: Constant.Tag, val: Constant, ty:
11546 builder: *const Builder,11546 builder: *const Builder,
11547 pub fn hash(_: @This(), key: Key) u32 {11547 pub fn hash(_: @This(), key: Key) u32 {
11548 return @truncate(std.hash.Wyhash.hash(11548 return @truncate(std.hash.Wyhash.hash(
11549 std.hash.uint32(@intFromEnum(key.tag)),11549 std.hash.int(@intFromEnum(key.tag)),
11550 std.mem.asBytes(&key.cast),11550 std.mem.asBytes(&key.cast),
11551 ));11551 ));
11552 }11552 }
...@@ -11621,7 +11621,7 @@ fn gepConstAssumeCapacity(...@@ -11621,7 +11621,7 @@ fn gepConstAssumeCapacity(
11621 const Adapter = struct {11621 const Adapter = struct {
11622 builder: *const Builder,11622 builder: *const Builder,
11623 pub fn hash(_: @This(), key: Key) u32 {11623 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)));
11625 hasher.update(std.mem.asBytes(&key.type));11625 hasher.update(std.mem.asBytes(&key.type));
11626 hasher.update(std.mem.asBytes(&key.base));11626 hasher.update(std.mem.asBytes(&key.base));
11627 hasher.update(std.mem.asBytes(&key.inrange));11627 hasher.update(std.mem.asBytes(&key.inrange));
...@@ -11685,7 +11685,7 @@ fn binConstAssumeCapacity(...@@ -11685,7 +11685,7 @@ fn binConstAssumeCapacity(
11685 builder: *const Builder,11685 builder: *const Builder,
11686 pub fn hash(_: @This(), key: Key) u32 {11686 pub fn hash(_: @This(), key: Key) u32 {
11687 return @truncate(std.hash.Wyhash.hash(11687 return @truncate(std.hash.Wyhash.hash(
11688 std.hash.uint32(@intFromEnum(key.tag)),11688 std.hash.int(@intFromEnum(key.tag)),
11689 std.mem.asBytes(&key.extra),11689 std.mem.asBytes(&key.extra),
11690 ));11690 ));
11691 }11691 }
...@@ -11723,7 +11723,7 @@ fn asmConstAssumeCapacity(...@@ -11723,7 +11723,7 @@ fn asmConstAssumeCapacity(
11723 builder: *const Builder,11723 builder: *const Builder,
11724 pub fn hash(_: @This(), key: Key) u32 {11724 pub fn hash(_: @This(), key: Key) u32 {
11725 return @truncate(std.hash.Wyhash.hash(11725 return @truncate(std.hash.Wyhash.hash(
11726 std.hash.uint32(@intFromEnum(key.tag)),11726 std.hash.int(@intFromEnum(key.tag)),
11727 std.mem.asBytes(&key.extra),11727 std.mem.asBytes(&key.extra),
11728 ));11728 ));
11729 }11729 }
...@@ -11773,7 +11773,7 @@ fn getOrPutConstantNoExtraAssumeCapacity(...@@ -11773,7 +11773,7 @@ fn getOrPutConstantNoExtraAssumeCapacity(
11773 builder: *const Builder,11773 builder: *const Builder,
11774 pub fn hash(_: @This(), key: Constant.Item) u32 {11774 pub fn hash(_: @This(), key: Constant.Item) u32 {
11775 return @truncate(std.hash.Wyhash.hash(11775 return @truncate(std.hash.Wyhash.hash(
11776 std.hash.uint32(@intFromEnum(key.tag)),11776 std.hash.int(@intFromEnum(key.tag)),
11777 std.mem.asBytes(&key.data),11777 std.mem.asBytes(&key.data),
11778 ));11778 ));
11779 }11779 }
...@@ -11804,7 +11804,7 @@ fn getOrPutConstantAggregateAssumeCapacity(...@@ -11804,7 +11804,7 @@ fn getOrPutConstantAggregateAssumeCapacity(
11804 const Adapter = struct {11804 const Adapter = struct {
11805 builder: *const Builder,11805 builder: *const Builder,
11806 pub fn hash(_: @This(), key: Key) u32 {11806 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)));
11808 hasher.update(std.mem.asBytes(&key.type));11808 hasher.update(std.mem.asBytes(&key.type));
11809 hasher.update(std.mem.sliceAsBytes(key.vals));11809 hasher.update(std.mem.sliceAsBytes(key.vals));
11810 return @truncate(hasher.final());11810 return @truncate(hasher.final());
...@@ -12421,7 +12421,7 @@ fn metadataSimpleAssumeCapacity(self: *Builder, tag: Metadata.Tag, value: anytyp...@@ -12421,7 +12421,7 @@ fn metadataSimpleAssumeCapacity(self: *Builder, tag: Metadata.Tag, value: anytyp
12421 const Adapter = struct {12421 const Adapter = struct {
12422 builder: *const Builder,12422 builder: *const Builder,
12423 pub fn hash(_: @This(), key: Key) u32 {12423 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)));
12425 inline for (std.meta.fields(@TypeOf(value))) |field| {12425 inline for (std.meta.fields(@TypeOf(value))) |field| {
12426 hasher.update(std.mem.asBytes(&@field(key.value, field.name)));12426 hasher.update(std.mem.asBytes(&@field(key.value, field.name)));
12427 }12427 }
...@@ -12457,7 +12457,7 @@ fn metadataDistinctAssumeCapacity(self: *Builder, tag: Metadata.Tag, value: anyt...@@ -12457,7 +12457,7 @@ fn metadataDistinctAssumeCapacity(self: *Builder, tag: Metadata.Tag, value: anyt
12457 const Adapter = struct {12457 const Adapter = struct {
12458 pub fn hash(_: @This(), key: Key) u32 {12458 pub fn hash(_: @This(), key: Key) u32 {
12459 return @truncate(std.hash.Wyhash.hash(12459 return @truncate(std.hash.Wyhash.hash(
12460 std.hash.uint32(@intFromEnum(key.tag)),12460 std.hash.int(@intFromEnum(key.tag)),
12461 std.mem.asBytes(&key.index),12461 std.mem.asBytes(&key.index),
12462 ));12462 ));
12463 }12463 }
...@@ -12853,7 +12853,7 @@ fn debugEnumeratorAssumeCapacity(...@@ -12853,7 +12853,7 @@ fn debugEnumeratorAssumeCapacity(
12853 const Adapter = struct {12853 const Adapter = struct {
12854 builder: *const Builder,12854 builder: *const Builder,
12855 pub fn hash(_: @This(), key: Key) u32 {12855 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)));
12857 hasher.update(std.mem.asBytes(&key.name));12857 hasher.update(std.mem.asBytes(&key.name));
12858 hasher.update(std.mem.asBytes(&key.bit_width));12858 hasher.update(std.mem.asBytes(&key.bit_width));
12859 hasher.update(std.mem.sliceAsBytes(key.value.limbs));12859 hasher.update(std.mem.sliceAsBytes(key.value.limbs));
...@@ -12935,7 +12935,7 @@ fn debugExpressionAssumeCapacity(...@@ -12935,7 +12935,7 @@ fn debugExpressionAssumeCapacity(
12935 const Adapter = struct {12935 const Adapter = struct {
12936 builder: *const Builder,12936 builder: *const Builder,
12937 pub fn hash(_: @This(), key: Key) u32 {12937 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)));
12939 hasher.update(std.mem.sliceAsBytes(key.elements));12939 hasher.update(std.mem.sliceAsBytes(key.elements));
12940 return @truncate(hasher.final());12940 return @truncate(hasher.final());
12941 }12941 }
...@@ -12981,7 +12981,7 @@ fn metadataTupleAssumeCapacity(...@@ -12981,7 +12981,7 @@ fn metadataTupleAssumeCapacity(
12981 const Adapter = struct {12981 const Adapter = struct {
12982 builder: *const Builder,12982 builder: *const Builder,
12983 pub fn hash(_: @This(), key: Key) u32 {12983 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)));
12985 hasher.update(std.mem.sliceAsBytes(key.elements));12985 hasher.update(std.mem.sliceAsBytes(key.elements));
12986 return @truncate(hasher.final());12986 return @truncate(hasher.final());
12987 }12987 }
...@@ -13029,7 +13029,7 @@ fn strTupleAssumeCapacity(...@@ -13029,7 +13029,7 @@ fn strTupleAssumeCapacity(
13029 const Adapter = struct {13029 const Adapter = struct {
13030 builder: *const Builder,13030 builder: *const Builder,
13031 pub fn hash(_: @This(), key: Key) u32 {13031 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)));
13033 hasher.update(std.mem.sliceAsBytes(key.elements));13033 hasher.update(std.mem.sliceAsBytes(key.elements));
13034 return @truncate(hasher.final());13034 return @truncate(hasher.final());
13035 }13035 }
...@@ -13159,7 +13159,7 @@ fn metadataConstantAssumeCapacity(self: *Builder, constant: Constant) Metadata {...@@ -13159,7 +13159,7 @@ fn metadataConstantAssumeCapacity(self: *Builder, constant: Constant) Metadata {
13159 const Adapter = struct {13159 const Adapter = struct {
13160 builder: *const Builder,13160 builder: *const Builder,
13161 pub fn hash(_: @This(), key: Constant) u32 {13161 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)));
13163 hasher.update(std.mem.asBytes(&key));13163 hasher.update(std.mem.asBytes(&key));
13164 return @truncate(hasher.final());13164 return @truncate(hasher.final());
13165 }13165 }
src/InternPool.zig+4-4
...@@ -1861,7 +1861,7 @@ pub const NullTerminatedString = enum(u32) {...@@ -1861,7 +1861,7 @@ pub const NullTerminatedString = enum(u32) {
18611861
1862 pub fn hash(ctx: @This(), a: NullTerminatedString) u32 {1862 pub fn hash(ctx: @This(), a: NullTerminatedString) u32 {
1863 _ = ctx;1863 _ = ctx;
1864 return std.hash.uint32(@intFromEnum(a));1864 return std.hash.int(@intFromEnum(a));
1865 }1865 }
1866 };1866 };
18671867
...@@ -4740,7 +4740,7 @@ pub const Index = enum(u32) {...@@ -4740,7 +4740,7 @@ pub const Index = enum(u32) {
47404740
4741 pub fn hash(ctx: @This(), a: Index) u32 {4741 pub fn hash(ctx: @This(), a: Index) u32 {
4742 _ = ctx;4742 _ = ctx;
4743 return std.hash.uint32(@intFromEnum(a));4743 return std.hash.int(@intFromEnum(a));
4744 }4744 }
4745 };4745 };
47464746
...@@ -12725,7 +12725,7 @@ const GlobalErrorSet = struct {...@@ -12725,7 +12725,7 @@ const GlobalErrorSet = struct {
12725 name: NullTerminatedString,12725 name: NullTerminatedString,
12726 ) Allocator.Error!GlobalErrorSet.Index {12726 ) Allocator.Error!GlobalErrorSet.Index {
12727 if (name == .empty) return .none;12727 if (name == .empty) return .none;
12728 const hash = std.hash.uint32(@intFromEnum(name));12728 const hash = std.hash.int(@intFromEnum(name));
12729 var map = ges.shared.map.acquire();12729 var map = ges.shared.map.acquire();
12730 const Map = @TypeOf(map);12730 const Map = @TypeOf(map);
12731 var map_mask = map.header().mask();12731 var map_mask = map.header().mask();
...@@ -12818,7 +12818,7 @@ const GlobalErrorSet = struct {...@@ -12818,7 +12818,7 @@ const GlobalErrorSet = struct {
12818 name: NullTerminatedString,12818 name: NullTerminatedString,
12819 ) ?GlobalErrorSet.Index {12819 ) ?GlobalErrorSet.Index {
12820 if (name == .empty) return .none;12820 if (name == .empty) return .none;
12821 const hash = std.hash.uint32(@intFromEnum(name));12821 const hash = std.hash.int(@intFromEnum(name));
12822 const map = ges.shared.map.acquire();12822 const map = ges.shared.map.acquire();
12823 const map_mask = map.header().mask();12823 const map_mask = map.header().mask();
12824 const names_items = ges.shared.names.acquire().view().items(.@"0");12824 const names_items = ges.shared.names.acquire().view().items(.@"0");
src/Zcu.zig+2-2
...@@ -808,7 +808,7 @@ pub const Namespace = struct {...@@ -808,7 +808,7 @@ pub const Namespace = struct {
808808
809 pub fn hash(ctx: NavNameContext, nav: InternPool.Nav.Index) u32 {809 pub fn hash(ctx: NavNameContext, nav: InternPool.Nav.Index) u32 {
810 const name = ctx.zcu.intern_pool.getNav(nav).name;810 const name = ctx.zcu.intern_pool.getNav(nav).name;
811 return std.hash.uint32(@intFromEnum(name));811 return std.hash.int(@intFromEnum(name));
812 }812 }
813813
814 pub fn eql(ctx: NavNameContext, a_nav: InternPool.Nav.Index, b_nav: InternPool.Nav.Index, b_index: usize) bool {814 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 {...@@ -824,7 +824,7 @@ pub const Namespace = struct {
824824
825 pub fn hash(ctx: NameAdapter, s: InternPool.NullTerminatedString) u32 {825 pub fn hash(ctx: NameAdapter, s: InternPool.NullTerminatedString) u32 {
826 _ = ctx;826 _ = ctx;
827 return std.hash.uint32(@intFromEnum(s));827 return std.hash.int(@intFromEnum(s));
828 }828 }
829829
830 pub fn eql(ctx: NameAdapter, a: InternPool.NullTerminatedString, b_nav: InternPool.Nav.Index, b_index: usize) bool {830 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...@@ -3974,7 +3974,7 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Inner
3974 var width_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };3974 var width_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
3975 width_bigint.sub(max_bigint, min_bigint);3975 width_bigint.sub(max_bigint, min_bigint);
3976 width_bigint.addScalar(width_bigint.toConst(), 1);3976 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;
3978 };3978 };
39793979
3980 try cg.startBlock(.block, .empty); // whole switch block start3980 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...@@ -4015,7 +4015,7 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Inner
4015 const val_bigint = val.toBigInt(&val_space, zcu);4015 const val_bigint = val.toBigInt(&val_space, zcu);
4016 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };4016 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
4017 index_bigint.sub(val_bigint, min_bigint);4017 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;
4019 }4019 }
4020 for (case.ranges) |range| {4020 for (case.ranges) |range| {
4021 var low_space: Value.BigIntSpace = undefined;4021 var low_space: Value.BigIntSpace = undefined;
...@@ -4024,9 +4024,9 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Inner...@@ -4024,9 +4024,9 @@ fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Inner
4024 const high_bigint = Value.fromInterned(range[1].toInterned().?).toBigInt(&high_space, zcu);4024 const high_bigint = Value.fromInterned(range[1].toInterned().?).toBigInt(&high_space, zcu);
4025 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };4025 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
4026 index_bigint.sub(low_bigint, min_bigint);4026 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;
4028 index_bigint.sub(high_bigint, min_bigint);4028 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;
4030 @memset(branch_list[start..end], case.idx);4030 @memset(branch_list[start..end], case.idx);
4031 }4031 }
4032 }4032 }
src/arch/wasm/Emit.zig+1-1
...@@ -263,7 +263,7 @@ pub fn lowerToCode(emit: *Emit) Error!void {...@@ -263,7 +263,7 @@ pub fn lowerToCode(emit: *Emit) Error!void {
263 code.appendNTimesAssumeCapacity(0, 5);263 code.appendNTimesAssumeCapacity(0, 5);
264 } else {264 } else {
265 const sp_global: Wasm.GlobalIndex = .stack_pointer;265 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;
267 }267 }
268268
269 inst += 1;269 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...@@ -687,7 +687,7 @@ pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayListUnmanaged(u8)) st
687 const sp_global: Wasm.GlobalIndex = .stack_pointer;687 const sp_global: Wasm.GlobalIndex = .stack_pointer;
688 // load stack pointer688 // load stack pointer
689 code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.global_get));689 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;
691 // store stack pointer so we can restore it when we return from the function691 // store stack pointer so we can restore it when we return from the function
692 code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.local_tee));692 code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.local_tee));
693 leb.writeUleb128(code.fixedWriter(), mir.prologue.sp_local) catch unreachable;693 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...@@ -710,7 +710,7 @@ pub fn lower(mir: *const Mir, wasm: *Wasm, code: *std.ArrayListUnmanaged(u8)) st
710 // Store the current stack pointer value into the global stack pointer so other function calls will710 // Store the current stack pointer value into the global stack pointer so other function calls will
711 // start from this value instead and not overwrite the current stack.711 // start from this value instead and not overwrite the current stack.
712 code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.global_set));712 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;
714 }714 }
715715
716 var emit: Emit = .{716 var emit: Emit = .{
src/arch/x86_64/CodeGen.zig+4-4
...@@ -179277,7 +179277,7 @@ fn lowerSwitchBr(...@@ -179277,7 +179277,7 @@ fn lowerSwitchBr(
179277 var table_len_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };179277 var table_len_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
179278 table_len_bigint.sub(max_bigint, min_bigint);179278 table_len_bigint.sub(max_bigint, min_bigint);
179279 assert(table_len_bigint.positive); // min <= max179279 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 table179280 break :table_len @as(u11, table_len_bigint.toConst().toInt(u10) catch break :table) + 1; // no more than a 1024 entry table
179281 };179281 };
179282 assert(prong_items <= table_len); // each prong item introduces at least one unique integer to the range179282 assert(prong_items <= table_len); // each prong item introduces at least one unique integer to the range
179283 if (prong_items < table_len >> 2) break :table; // no more than 75% waste179283 if (prong_items < table_len >> 2) break :table; // no more than 75% waste
...@@ -179353,7 +179353,7 @@ fn lowerSwitchBr(...@@ -179353,7 +179353,7 @@ fn lowerSwitchBr(
179353 const val_bigint = val.toBigInt(&val_space, zcu);179353 const val_bigint = val.toBigInt(&val_space, zcu);
179354 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };179354 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
179355 index_bigint.sub(val_bigint, min_bigint);179355 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);
179357 }179357 }
179358 for (case.ranges) |range| {179358 for (case.ranges) |range| {
179359 var low_space: Value.BigIntSpace = undefined;179359 var low_space: Value.BigIntSpace = undefined;
...@@ -179362,9 +179362,9 @@ fn lowerSwitchBr(...@@ -179362,9 +179362,9 @@ fn lowerSwitchBr(
179362 const high_bigint = Value.fromInterned(range[1].toInterned().?).toBigInt(&high_space, zcu);179362 const high_bigint = Value.fromInterned(range[1].toInterned().?).toBigInt(&high_space, zcu);
179363 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };179363 var index_bigint: std.math.big.int.Mutable = .{ .limbs = limbs, .positive = undefined, .len = undefined };
179364 index_bigint.sub(low_bigint, min_bigint);179364 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;
179366 index_bigint.sub(high_bigint, min_bigint);179366 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;
179368 @memset(table[start..end], @intCast(cg.mir_instructions.len));179368 @memset(table[start..end], @intCast(cg.mir_instructions.len));
179369 }179369 }
179370 }179370 }
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...@@ -189,9 +189,9 @@ fn finalizeNode(self: *Trie, node_index: Node.Index, offset_in_trie: u32) !Final
189 if (slice.items(.is_terminal)[node_index]) {189 if (slice.items(.is_terminal)[node_index]) {
190 const export_flags = slice.items(.export_flags)[node_index];190 const export_flags = slice.items(.export_flags)[node_index];
191 const vmaddr_offset = slice.items(.vmaddr_offset)[node_index];191 const vmaddr_offset = slice.items(.vmaddr_offset)[node_index];
192 try leb.writeULEB128(writer, export_flags);192 try leb.writeUleb128(writer, export_flags);
193 try leb.writeULEB128(writer, vmaddr_offset);193 try leb.writeUleb128(writer, vmaddr_offset);
194 try leb.writeULEB128(writer, stream.bytes_written);194 try leb.writeUleb128(writer, stream.bytes_written);
195 } else {195 } else {
196 node_size += 1; // 0x0 for non-terminal nodes196 node_size += 1; // 0x0 for non-terminal nodes
197 }197 }
...@@ -201,7 +201,7 @@ fn finalizeNode(self: *Trie, node_index: Node.Index, offset_in_trie: u32) !Final...@@ -201,7 +201,7 @@ fn finalizeNode(self: *Trie, node_index: Node.Index, offset_in_trie: u32) !Final
201 const edge = &self.edges.items[edge_index];201 const edge = &self.edges.items[edge_index];
202 const next_node_offset = slice.items(.trie_offset)[edge.node];202 const next_node_offset = slice.items(.trie_offset)[edge.node];
203 node_size += @intCast(edge.label.len + 1);203 node_size += @intCast(edge.label.len + 1);
204 try leb.writeULEB128(writer, next_node_offset);204 try leb.writeUleb128(writer, next_node_offset);
205 }205 }
206206
207 const trie_offset = slice.items(.trie_offset)[node_index];207 const trie_offset = slice.items(.trie_offset)[node_index];
...@@ -251,13 +251,13 @@ fn writeNode(self: *Trie, node_index: Node.Index, writer: anytype) !void {...@@ -251,13 +251,13 @@ fn writeNode(self: *Trie, node_index: Node.Index, writer: anytype) !void {
251 // TODO Implement for special flags.251 // TODO Implement for special flags.
252 assert(export_flags & macho.EXPORT_SYMBOL_FLAGS_REEXPORT == 0 and252 assert(export_flags & macho.EXPORT_SYMBOL_FLAGS_REEXPORT == 0 and
253 export_flags & macho.EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER == 0);253 export_flags & macho.EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER == 0);
254 try leb.writeULEB128(info_stream.writer(), export_flags);254 try leb.writeUleb128(info_stream.writer(), export_flags);
255 try leb.writeULEB128(info_stream.writer(), vmaddr_offset);255 try leb.writeUleb128(info_stream.writer(), vmaddr_offset);
256256
257 // Encode the size of the terminal node info.257 // Encode the size of the terminal node info.
258 var size_buf: [@sizeOf(u64)]u8 = undefined;258 var size_buf: [@sizeOf(u64)]u8 = undefined;
259 var size_stream = std.io.fixedBufferStream(&size_buf);259 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
262 // Now, write them to the output stream.262 // Now, write them to the output stream.
263 try writer.writeAll(size_buf[0..size_stream.pos]);263 try writer.writeAll(size_buf[0..size_stream.pos]);
...@@ -274,7 +274,7 @@ fn writeNode(self: *Trie, node_index: Node.Index, writer: anytype) !void {...@@ -274,7 +274,7 @@ fn writeNode(self: *Trie, node_index: Node.Index, writer: anytype) !void {
274 // Write edge label and offset to next node in trie.274 // Write edge label and offset to next node in trie.
275 try writer.writeAll(edge.label);275 try writer.writeAll(edge.label);
276 try writer.writeByte(0);276 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]);
278 }278 }
279}279}
280280
src/link/Wasm/Flush.zig+1-1
...@@ -146,7 +146,7 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {...@@ -146,7 +146,7 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {
146 const int_tag_ty = Zcu.Type.fromInterned(data.ip_index).intTagType(zcu);146 const int_tag_ty = Zcu.Type.fromInterned(data.ip_index).intTagType(zcu);
147 gop.value_ptr.* = .{ .tag_name = .{147 gop.value_ptr.* = .{ .tag_name = .{
148 .symbol_name = try wasm.internStringFmt("__zig_tag_name_{d}", .{@intFromEnum(data.ip_index)}),148 .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),
150 .table_index = @intCast(wasm.tag_name_offs.items.len),150 .table_index = @intCast(wasm.tag_name_offs.items.len),
151 } };151 } };
152 try wasm.functions.put(gpa, .fromZcuFunc(wasm, @enumFromInt(gop.index)), {});152 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" {...@@ -153,9 +153,9 @@ test "extern struct with stdcallcc fn pointer" {
153 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;153 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
154154
155 const S = extern struct {155 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 {
159 return 1234;159 return 1234;
160 }160 }
161 };161 };
...@@ -170,8 +170,8 @@ fn fComplexCallconvRet(x: u32) callconv(blk: {...@@ -170,8 +170,8 @@ fn fComplexCallconvRet(x: u32) callconv(blk: {
170 const s: struct { n: u32 } = .{ .n = nComplexCallconv };170 const s: struct { n: u32 } = .{ .n = nComplexCallconv };
171 break :blk switch (s.n) {171 break :blk switch (s.n) {
172 0 => .c,172 0 => .c,
173 1 => .Inline,173 1 => .@"inline",
174 else => .Unspecified,174 else => .auto,
175 };175 };
176}) struct { x: u32 } {176}) struct { x: u32 } {
177 return .{ .x = x * x };177 return .{ .x = x * x };
test/behavior/type.zig+1-1
...@@ -670,7 +670,7 @@ test "reified function type params initialized with field pointer" {...@@ -670,7 +670,7 @@ test "reified function type params initialized with field pointer" {
670 };670 };
671 const Bar = @Type(.{671 const Bar = @Type(.{
672 .@"fn" = .{672 .@"fn" = .{
673 .calling_convention = .Unspecified,673 .calling_convention = .auto,
674 .is_generic = false,674 .is_generic = false,
675 .is_var_args = false,675 .is_var_args = false,
676 .return_type = void,676 .return_type = void,
test/c_abi/main.zig+1-1
...@@ -5763,7 +5763,7 @@ test "f128 f128 struct" {...@@ -5763,7 +5763,7 @@ test "f128 f128 struct" {
5763}5763}
57645764
5765// The stdcall attribute on C functions is ignored when compiled on non-x865765// 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
5768extern fn stdcall_scalars(i8, i16, i32, f32, f64) callconv(stdcall_callconv) void;5768extern fn stdcall_scalars(i8, i16, i32, f32, f64) callconv(stdcall_callconv) void;
5769test "Stdcall ABI scalars" {5769test "Stdcall ABI scalars" {
test/cases/compile_errors/callconv_from_global_variable.zig+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1var cc: @import("std").builtin.CallingConvention = .C;1var cc: @import("std").builtin.CallingConvention = .c;
2export fn foo() callconv(cc) void {}2export fn foo() callconv(cc) void {}
33
4// error4// 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 {...@@ -12,5 +12,5 @@ fn foo(set1: Set1) void {
12// backend=stage212// backend=stage2
13// target=native13// target=native
14//14//
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}'
16// :7:21: note: 'error.B' not a member of destination error set16// :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 @@...@@ -1,6 +1,6 @@
1const Foo = @Type(.{1const Foo = @Type(.{
2 .@"fn" = .{2 .@"fn" = .{
3 .calling_convention = .Unspecified,3 .calling_convention = .auto,
4 .is_generic = true,4 .is_generic = true,
5 .is_var_args = false,5 .is_var_args = false,
6 .return_type = u0,6 .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 @@...@@ -1,6 +1,6 @@
1const Foo = @Type(.{1const Foo = @Type(.{
2 .@"fn" = .{2 .@"fn" = .{
3 .calling_convention = .Unspecified,3 .calling_convention = .auto,
4 .is_generic = false,4 .is_generic = false,
5 .is_var_args = true,5 .is_var_args = true,
6 .return_type = u0,6 .return_type = u0,
test/cases/compile_errors/reify_type.Fn_with_return_type_null.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const Foo = @Type(.{1const Foo = @Type(.{
2 .@"fn" = .{2 .@"fn" = .{
3 .calling_convention = .Unspecified,3 .calling_convention = .auto,
4 .is_generic = false,4 .is_generic = false,
5 .is_var_args = false,5 .is_var_args = false,
6 .return_type = null,6 .return_type = null,
test/src/LlvmIr.zig+14-12
...@@ -90,19 +90,21 @@ pub fn addCase(self: *LlvmIr, case: TestCase) void {...@@ -90,19 +90,21 @@ pub fn addCase(self: *LlvmIr, case: TestCase) void {
9090
91 const obj = self.b.addObject(.{91 const obj = self.b.addObject(.{
92 .name = "test",92 .name = "test",
93 .root_source_file = self.b.addWriteFiles().add("test.zig", case.source),93 .root_module = self.b.createModule(.{
94 .use_llvm = true,94 .root_source_file = self.b.addWriteFiles().add("test.zig", case.source),
9595
96 .code_model = case.params.code_model,96 .code_model = case.params.code_model,
97 .error_tracing = case.params.error_tracing,97 .error_tracing = case.params.error_tracing,
98 .omit_frame_pointer = case.params.omit_frame_pointer,98 .omit_frame_pointer = case.params.omit_frame_pointer,
99 .optimize = case.params.optimize,99 .optimize = case.params.optimize,
100 .pic = case.params.pic,100 .pic = case.params.pic,
101 .sanitize_thread = case.params.sanitize_thread,101 .sanitize_thread = case.params.sanitize_thread,
102 .single_threaded = case.params.single_threaded,102 .single_threaded = case.params.single_threaded,
103 .strip = case.params.strip,103 .strip = case.params.strip,
104 .target = target,104 .target = target,
105 .unwind_tables = case.params.unwind_tables,105 .unwind_tables = case.params.unwind_tables,
106 }),
107 .use_llvm = true,
106 });108 });
107109
108 obj.dll_export_fns = case.params.dll_export_fns;110 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 {...@@ -8,8 +8,10 @@ pub fn build(b: *std.Build) void {
88
9 const exe = b.addExecutable(.{9 const exe = b.addExecutable(.{
10 .name = "test",10 .name = "test",
11 .target = b.graph.host,11 .root_module = b.createModule(.{
12 .optimize = optimize,12 .target = b.graph.host,
13 .optimize = optimize,
14 }),
13 });15 });
14 exe.addCSourceFile(.{16 exe.addCSourceFile(.{
15 .file = b.path("test.c"),17 .file = b.path("test.c"),
test/standalone/config_header/build.zig+1-1
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
22
3pub fn build(b: *std.Build) void {3pub fn build(b: *std.Build) void {
4 const config_header = b.addConfigHeader(4 const config_header = b.addConfigHeader(
5 .{ .style = .{ .autoconf = b.path("config.h.in") } },5 .{ .style = .{ .autoconf_undef = b.path("config.h.in") } },
6 .{6 .{
7 .SOME_NO = null,7 .SOME_NO = null,
8 .SOME_TRUE = true,8 .SOME_TRUE = true,
tools/docgen.zig+1-1
...@@ -10,7 +10,7 @@ const mem = std.mem;...@@ -10,7 +10,7 @@ const mem = std.mem;
10const testing = std.testing;10const testing = std.testing;
11const Allocator = std.mem.Allocator;11const Allocator = std.mem.Allocator;
12const getExternalExecutor = std.zig.system.getExternalExecutor;12const getExternalExecutor = std.zig.system.getExternalExecutor;
13const fatal = std.zig.fatal;13const fatal = std.process.fatal;
1414
15const max_doc_file_size = 10 * 1024 * 1024;15const max_doc_file_size = 10 * 1024 * 1024;
1616
tools/doctest.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
2const std = @import("std");2const std = @import("std");
3const fatal = std.zig.fatal;3const fatal = std.process.fatal;
4const mem = std.mem;4const mem = std.mem;
5const fs = std.fs;5const fs = std.fs;
6const process = std.process;6const process = std.process;
tools/migrate_langref.zig+1-1
...@@ -7,7 +7,7 @@ const mem = std.mem;...@@ -7,7 +7,7 @@ const mem = std.mem;
7const testing = std.testing;7const testing = std.testing;
8const Allocator = std.mem.Allocator;8const Allocator = std.mem.Allocator;
9const max_doc_file_size = 10 * 1024 * 1024;9const max_doc_file_size = 10 * 1024 * 1024;
10const fatal = std.zig.fatal;10const fatal = std.process.fatal;
1111
12pub fn main() !void {12pub fn main() !void {
13 var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator);13 var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator);