From 4183c6f1a52959ab5eef540c8eec1758079554eb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 23 Dec 2017 22:08:53 -0500 Subject: [PATCH] move std/debug.zig to a subdirectory self hosted compiler parser tests do some fuzz testing --- CMakeLists.txt | 3 +- build.zig | 3 +- src-self-hosted/parser.zig | 30 ++++++---- std/array_list.zig | 5 +- std/base64.zig | 5 +- std/buffer.zig | 9 +-- std/cstr.zig | 5 +- std/debug/failing_allocator.zig | 64 +++++++++++++++++++++ std/{debug.zig => debug/index.zig} | 62 +------------------- std/fmt/errol/index.zig | 7 ++- std/fmt/index.zig | 7 ++- std/hash_map.zig | 7 ++- std/heap.zig | 9 +-- std/index.zig | 4 +- std/linked_list.zig | 5 +- std/math/acos.zig | 5 +- std/math/acosh.zig | 5 +- std/math/asin.zig | 5 +- std/math/asinh.zig | 5 +- std/math/atan.zig | 5 +- std/math/atan2.zig | 5 +- std/math/atanh.zig | 5 +- std/math/cbrt.zig | 5 +- std/math/ceil.zig | 5 +- std/math/copysign.zig | 5 +- std/math/cos.zig | 5 +- std/math/cosh.zig | 5 +- std/math/exp.zig | 5 +- std/math/exp2.zig | 5 +- std/math/expm1.zig | 5 +- std/math/fabs.zig | 5 +- std/math/floor.zig | 5 +- std/math/fma.zig | 5 +- std/math/frexp.zig | 5 +- std/math/hypot.zig | 5 +- std/math/ilogb.zig | 5 +- std/math/index.zig | 3 +- std/math/inf.zig | 5 +- std/math/isfinite.zig | 5 +- std/math/isinf.zig | 5 +- std/math/isnan.zig | 5 +- std/math/isnormal.zig | 5 +- std/math/ln.zig | 5 +- std/math/log.zig | 5 +- std/math/log10.zig | 5 +- std/math/log1p.zig | 5 +- std/math/log2.zig | 5 +- std/math/modf.zig | 5 +- std/math/pow.zig | 5 +- std/math/round.zig | 5 +- std/math/scalbn.zig | 5 +- std/math/signbit.zig | 5 +- std/math/sin.zig | 5 +- std/math/sinh.zig | 5 +- std/math/sqrt.zig | 5 +- std/math/tan.zig | 5 +- std/math/tanh.zig | 5 +- std/math/trunc.zig | 5 +- std/mem.zig | 5 +- std/net.zig | 7 ++- std/os/darwin.zig | 5 +- std/os/index.zig | 21 +++---- std/os/linux.zig | 3 +- std/os/path.zig | 14 ++--- std/rand.zig | 7 ++- std/special/compiler_rt/fixunsdfdi_test.zig | 2 +- std/special/compiler_rt/fixunsdfsi_test.zig | 2 +- std/special/compiler_rt/fixunsdfti_test.zig | 2 +- std/special/compiler_rt/fixunssfdi_test.zig | 2 +- std/special/compiler_rt/fixunssfsi_test.zig | 2 +- std/special/compiler_rt/fixunssfti_test.zig | 2 +- std/special/compiler_rt/fixunstfdi_test.zig | 2 +- std/special/compiler_rt/fixunstfsi_test.zig | 2 +- std/special/compiler_rt/fixunstfti_test.zig | 2 +- std/special/compiler_rt/index.zig | 2 +- 75 files changed, 297 insertions(+), 223 deletions(-) create mode 100644 std/debug/failing_allocator.zig rename std/{debug.zig => debug/index.zig} (94%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8e2d9ff7..b94b4e132 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -516,7 +516,8 @@ install(FILES "${CMAKE_SOURCE_DIR}/std/c/index.zig" DESTINATION "${ZIG_STD_DEST} install(FILES "${CMAKE_SOURCE_DIR}/std/c/linux.zig" DESTINATION "${ZIG_STD_DEST}/c") install(FILES "${CMAKE_SOURCE_DIR}/std/c/windows.zig" DESTINATION "${ZIG_STD_DEST}/c") install(FILES "${CMAKE_SOURCE_DIR}/std/cstr.zig" DESTINATION "${ZIG_STD_DEST}") -install(FILES "${CMAKE_SOURCE_DIR}/std/debug.zig" DESTINATION "${ZIG_STD_DEST}") +install(FILES "${CMAKE_SOURCE_DIR}/std/debug/index.zig" DESTINATION "${ZIG_STD_DEST}/debug") +install(FILES "${CMAKE_SOURCE_DIR}/std/debug/failing_allocator.zig" DESTINATION "${ZIG_STD_DEST}/debug") install(FILES "${CMAKE_SOURCE_DIR}/std/dwarf.zig" DESTINATION "${ZIG_STD_DEST}") install(FILES "${CMAKE_SOURCE_DIR}/std/elf.zig" DESTINATION "${ZIG_STD_DEST}") install(FILES "${CMAKE_SOURCE_DIR}/std/empty.zig" DESTINATION "${ZIG_STD_DEST}") diff --git a/build.zig b/build.zig index dbb54f8c3..e6564db96 100644 --- a/build.zig +++ b/build.zig @@ -172,7 +172,8 @@ pub fn installStdLib(b: &Builder) { "c/linux.zig", "c/windows.zig", "cstr.zig", - "debug.zig", + "debug/failing_allocator.zig", + "debug/index.zig", "dwarf.zig", "elf.zig", "empty.zig", diff --git a/src-self-hosted/parser.zig b/src-self-hosted/parser.zig index c997536ce..faba8e605 100644 --- a/src-self-hosted/parser.zig +++ b/src-self-hosted/parser.zig @@ -1119,18 +1119,24 @@ fn testCanonical(source: []const u8) { break :x failing_allocator.index; }; - // TODO make this pass - //var fail_index = needed_alloc_count; - //while (fail_index != 0) { - // fail_index -= 1; - // var fixed_allocator = mem.FixedBufferAllocator.init(fixed_buffer_mem[0..]); - // var failing_allocator = std.debug.FailingAllocator.init(&fixed_allocator.allocator, fail_index); - // if (testParse(source, &failing_allocator.allocator)) |_| { - // @panic("non-deterministic memory usage"); - // } else |err| { - // assert(err == error.OutOfMemory); - // } - //} + var fail_index: usize = 0; + while (fail_index < needed_alloc_count) : (fail_index += 1) { + var fixed_allocator = mem.FixedBufferAllocator.init(fixed_buffer_mem[0..]); + var failing_allocator = std.debug.FailingAllocator.init(&fixed_allocator.allocator, fail_index); + if (testParse(source, &failing_allocator.allocator)) |_| { + @panic("non-deterministic memory usage"); + } else |err| { + assert(err == error.OutOfMemory); + // TODO make this pass + //if (failing_allocator.allocated_bytes != failing_allocator.freed_bytes) { + // warn("\nfail_index: {}/{}\nallocated bytes: {}\nfreed bytes: {}\nallocations: {}\ndeallocations: {}\n", + // fail_index, needed_alloc_count, + // failing_allocator.allocated_bytes, failing_allocator.freed_bytes, + // failing_allocator.index, failing_allocator.deallocations); + // @panic("memory leak detected"); + //} + } + } } test "zig fmt" { diff --git a/std/array_list.zig b/std/array_list.zig index 04db4dd28..db5581dc0 100644 --- a/std/array_list.zig +++ b/std/array_list.zig @@ -1,6 +1,7 @@ -const debug = @import("debug.zig"); +const std = @import("index.zig"); +const debug = std.debug; const assert = debug.assert; -const mem = @import("mem.zig"); +const mem = std.mem; const Allocator = mem.Allocator; pub fn ArrayList(comptime T: type) -> type { diff --git a/std/base64.zig b/std/base64.zig index 840643b56..0b405b1f4 100644 --- a/std/base64.zig +++ b/std/base64.zig @@ -1,5 +1,6 @@ -const assert = @import("debug.zig").assert; -const mem = @import("mem.zig"); +const std = @import("index.zig"); +const assert = std.debug.assert; +const mem = std.mem; pub const standard_alphabet_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; pub const standard_pad_char = '='; diff --git a/std/buffer.zig b/std/buffer.zig index 4f5d281f4..2bb395d0f 100644 --- a/std/buffer.zig +++ b/std/buffer.zig @@ -1,10 +1,11 @@ -const debug = @import("debug.zig"); -const mem = @import("mem.zig"); +const std = @import("index.zig"); +const debug = std.debug; +const mem = std.mem; const Allocator = mem.Allocator; const assert = debug.assert; -const ArrayList = @import("array_list.zig").ArrayList; +const ArrayList = std.ArrayList; -const fmt = @import("fmt/index.zig"); +const fmt = std.fmt; /// A buffer that allocates memory and maintains a null byte at the end. pub const Buffer = struct { diff --git a/std/cstr.zig b/std/cstr.zig index 445f7ab89..d17b69c7a 100644 --- a/std/cstr.zig +++ b/std/cstr.zig @@ -1,5 +1,6 @@ -const debug = @import("debug.zig"); -const mem = @import("mem.zig"); +const std = @import("index.zig"); +const debug = std.debug; +const mem = std.mem; const assert = debug.assert; pub fn len(ptr: &const u8) -> usize { diff --git a/std/debug/failing_allocator.zig b/std/debug/failing_allocator.zig new file mode 100644 index 000000000..9b12ff5cb --- /dev/null +++ b/std/debug/failing_allocator.zig @@ -0,0 +1,64 @@ +const std = @import("../index.zig"); +const mem = std.mem; + +/// Allocator that fails after N allocations, useful for making sure out of +/// memory conditions are handled correctly. +pub const FailingAllocator = struct { + allocator: mem.Allocator, + index: usize, + fail_index: usize, + internal_allocator: &mem.Allocator, + allocated_bytes: usize, + freed_bytes: usize, + deallocations: usize, + + pub fn init(allocator: &mem.Allocator, fail_index: usize) -> FailingAllocator { + return FailingAllocator { + .internal_allocator = allocator, + .fail_index = fail_index, + .index = 0, + .allocated_bytes = 0, + .freed_bytes = 0, + .deallocations = 0, + .allocator = mem.Allocator { + .allocFn = alloc, + .reallocFn = realloc, + .freeFn = free, + }, + }; + } + + fn alloc(allocator: &mem.Allocator, n: usize, alignment: u29) -> %[]u8 { + const self = @fieldParentPtr(FailingAllocator, "allocator", allocator); + if (self.index == self.fail_index) { + return error.OutOfMemory; + } + const result = %return self.internal_allocator.allocFn(self.internal_allocator, n, alignment); + self.allocated_bytes += result.len; + self.index += 1; + return result; + } + + fn realloc(allocator: &mem.Allocator, old_mem: []u8, new_size: usize, alignment: u29) -> %[]u8 { + const self = @fieldParentPtr(FailingAllocator, "allocator", allocator); + if (new_size <= old_mem.len) { + self.freed_bytes += old_mem.len - new_size; + return self.internal_allocator.reallocFn(self.internal_allocator, old_mem, new_size, alignment); + } + if (self.index == self.fail_index) { + return error.OutOfMemory; + } + const result = %return self.internal_allocator.reallocFn(self.internal_allocator, old_mem, new_size, alignment); + self.allocated_bytes += new_size - old_mem.len; + self.deallocations += 1; + self.index += 1; + return result; + } + + fn free(allocator: &mem.Allocator, bytes: []u8) { + const self = @fieldParentPtr(FailingAllocator, "allocator", allocator); + self.freed_bytes += bytes.len; + self.deallocations += 1; + return self.internal_allocator.freeFn(self.internal_allocator, bytes); + } +}; diff --git a/std/debug.zig b/std/debug/index.zig similarity index 94% rename from std/debug.zig rename to std/debug/index.zig index a683b5ae1..e1025b291 100644 --- a/std/debug.zig +++ b/std/debug/index.zig @@ -1,10 +1,10 @@ -const std = @import("index.zig"); +const std = @import("../index.zig"); const math = std.math; const mem = std.mem; const io = std.io; const os = std.os; -const elf = @import("elf.zig"); -const DW = @import("dwarf.zig"); +const elf = std.elf; +const DW = std.dwarf; const ArrayList = std.ArrayList; const builtin = @import("builtin"); @@ -992,59 +992,3 @@ fn readILeb128(in_stream: &io.InStream) -> %i64 { pub const global_allocator = &global_fixed_allocator.allocator; var global_fixed_allocator = mem.FixedBufferAllocator.init(global_allocator_mem[0..]); var global_allocator_mem: [100 * 1024]u8 = undefined; - -/// Allocator that fails after N allocations, useful for making sure out of -/// memory conditions are handled correctly. -pub const FailingAllocator = struct { - allocator: mem.Allocator, - index: usize, - fail_index: usize, - internal_allocator: &mem.Allocator, - allocated_bytes: usize, - - pub fn init(allocator: &mem.Allocator, fail_index: usize) -> FailingAllocator { - return FailingAllocator { - .internal_allocator = allocator, - .fail_index = fail_index, - .index = 0, - .allocated_bytes = 0, - .allocator = mem.Allocator { - .allocFn = alloc, - .reallocFn = realloc, - .freeFn = free, - }, - }; - } - - fn alloc(allocator: &mem.Allocator, n: usize, alignment: u29) -> %[]u8 { - const self = @fieldParentPtr(FailingAllocator, "allocator", allocator); - if (self.index == self.fail_index) { - return error.OutOfMemory; - } - self.index += 1; - const result = %return self.internal_allocator.allocFn(self.internal_allocator, n, alignment); - self.allocated_bytes += result.len; - return result; - } - - fn realloc(allocator: &mem.Allocator, old_mem: []u8, new_size: usize, alignment: u29) -> %[]u8 { - const self = @fieldParentPtr(FailingAllocator, "allocator", allocator); - if (new_size <= old_mem.len) { - self.allocated_bytes -= old_mem.len - new_size; - return self.internal_allocator.reallocFn(self.internal_allocator, old_mem, new_size, alignment); - } - if (self.index == self.fail_index) { - return error.OutOfMemory; - } - self.index += 1; - const result = %return self.internal_allocator.reallocFn(self.internal_allocator, old_mem, new_size, alignment); - self.allocated_bytes += new_size - old_mem.len; - return result; - } - - fn free(allocator: &mem.Allocator, bytes: []u8) { - const self = @fieldParentPtr(FailingAllocator, "allocator", allocator); - self.allocated_bytes -= bytes.len; - return self.internal_allocator.freeFn(self.internal_allocator, bytes); - } -}; diff --git a/std/fmt/errol/index.zig b/std/fmt/errol/index.zig index 0a1ea7dee..ba4447c63 100644 --- a/std/fmt/errol/index.zig +++ b/std/fmt/errol/index.zig @@ -1,10 +1,11 @@ +const std = @import("../../index.zig"); const enum3 = @import("enum3.zig").enum3; const enum3_data = @import("enum3.zig").enum3_data; const lookup_table = @import("lookup.zig").lookup_table; const HP = @import("lookup.zig").HP; -const math = @import("../../math/index.zig"); -const mem = @import("../../mem.zig"); -const assert = @import("../../debug.zig").assert; +const math = std.math; +const mem = std.mem; +const assert = std.debug.assert; pub const FloatDecimal = struct { digits: []u8, diff --git a/std/fmt/index.zig b/std/fmt/index.zig index fef968a1d..550fa1ce1 100644 --- a/std/fmt/index.zig +++ b/std/fmt/index.zig @@ -1,7 +1,8 @@ -const math = @import("../math/index.zig"); -const debug = @import("../debug.zig"); +const std = @import("../index.zig"); +const math = std.math; +const debug = std.debug; const assert = debug.assert; -const mem = @import("../mem.zig"); +const mem = std.mem; const builtin = @import("builtin"); const errol3 = @import("errol/index.zig").errol3; diff --git a/std/hash_map.zig b/std/hash_map.zig index 837ee0742..cf8381579 100644 --- a/std/hash_map.zig +++ b/std/hash_map.zig @@ -1,7 +1,8 @@ -const debug = @import("debug.zig"); +const std = @import("index.zig"); +const debug = std.debug; const assert = debug.assert; -const math = @import("math/index.zig"); -const mem = @import("mem.zig"); +const math = std.math; +const mem = std.mem; const Allocator = mem.Allocator; const builtin = @import("builtin"); diff --git a/std/heap.zig b/std/heap.zig index ec447c1aa..6a78692ec 100644 --- a/std/heap.zig +++ b/std/heap.zig @@ -1,10 +1,11 @@ -const debug = @import("debug.zig"); +const std = @import("index.zig"); +const debug = std.debug; const assert = debug.assert; -const mem = @import("mem.zig"); -const os = @import("os/index.zig"); +const mem = std.mem; +const os = std.os; const builtin = @import("builtin"); const Os = builtin.Os; -const c = @import("c/index.zig"); +const c = std.c; const Allocator = mem.Allocator; diff --git a/std/index.zig b/std/index.zig index 323eee203..07da469b5 100644 --- a/std/index.zig +++ b/std/index.zig @@ -11,7 +11,7 @@ pub const base64 = @import("base64.zig"); pub const build = @import("build.zig"); pub const c = @import("c/index.zig"); pub const cstr = @import("cstr.zig"); -pub const debug = @import("debug.zig"); +pub const debug = @import("debug/index.zig"); pub const dwarf = @import("dwarf.zig"); pub const elf = @import("elf.zig"); pub const empty_import = @import("empty.zig"); @@ -39,7 +39,7 @@ test "std" { _ = @import("build.zig"); _ = @import("c/index.zig"); _ = @import("cstr.zig"); - _ = @import("debug.zig"); + _ = @import("debug/index.zig"); _ = @import("dwarf.zig"); _ = @import("elf.zig"); _ = @import("empty.zig"); diff --git a/std/linked_list.zig b/std/linked_list.zig index f4b6d274c..3c516dab7 100644 --- a/std/linked_list.zig +++ b/std/linked_list.zig @@ -1,6 +1,7 @@ -const debug = @import("debug.zig"); +const std = @import("index.zig"); +const debug = std.debug; const assert = debug.assert; -const mem = @import("mem.zig"); +const mem = std.mem; const Allocator = mem.Allocator; /// Generic doubly linked list. diff --git a/std/math/acos.zig b/std/math/acos.zig index 7690497da..478d5a846 100644 --- a/std/math/acos.zig +++ b/std/math/acos.zig @@ -2,8 +2,9 @@ // // - acos(x) = nan if x < -1 or x > 1 -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn acos(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/acosh.zig b/std/math/acosh.zig index 3b2c2c0f3..150bcd454 100644 --- a/std/math/acosh.zig +++ b/std/math/acosh.zig @@ -4,8 +4,9 @@ // - acosh(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn acosh(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/asin.zig b/std/math/asin.zig index c5d24c35e..a0209be0c 100644 --- a/std/math/asin.zig +++ b/std/math/asin.zig @@ -3,8 +3,9 @@ // - asin(+-0) = +-0 // - asin(x) = nan if x < -1 or x > 1 -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn asin(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/asinh.zig b/std/math/asinh.zig index f963dae77..d95565fc6 100644 --- a/std/math/asinh.zig +++ b/std/math/asinh.zig @@ -4,8 +4,9 @@ // - asinh(+-inf) = +-inf // - asinh(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn asinh(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/atan.zig b/std/math/atan.zig index cf244eb76..fbfade50a 100644 --- a/std/math/atan.zig +++ b/std/math/atan.zig @@ -3,8 +3,9 @@ // - atan(+-0) = +-0 // - atan(+-inf) = +-pi/2 -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn atan(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/atan2.zig b/std/math/atan2.zig index b3af18cd9..11e1b8cd8 100644 --- a/std/math/atan2.zig +++ b/std/math/atan2.zig @@ -18,8 +18,9 @@ // atan2(+inf, x) = +pi/2 // atan2(-inf, x) = -pi/2 -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; fn atan2(comptime T: type, x: T, y: T) -> T { return switch (T) { diff --git a/std/math/atanh.zig b/std/math/atanh.zig index 13de90279..e78750676 100644 --- a/std/math/atanh.zig +++ b/std/math/atanh.zig @@ -4,8 +4,9 @@ // - atanh(x) = nan if |x| > 1 with signal // - atanh(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn atanh(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/cbrt.zig b/std/math/cbrt.zig index a8df75dff..9725716f3 100644 --- a/std/math/cbrt.zig +++ b/std/math/cbrt.zig @@ -4,8 +4,9 @@ // - cbrt(+-inf) = +-inf // - cbrt(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn cbrt(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/ceil.zig b/std/math/ceil.zig index 8e27132e2..141b5c0fc 100644 --- a/std/math/ceil.zig +++ b/std/math/ceil.zig @@ -5,8 +5,9 @@ // - ceil(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn ceil(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/copysign.zig b/std/math/copysign.zig index 05205e1a0..ebf12313f 100644 --- a/std/math/copysign.zig +++ b/std/math/copysign.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn copysign(comptime T: type, x: T, y: T) -> T { return switch (T) { diff --git a/std/math/cos.zig b/std/math/cos.zig index 4c3b8e128..a65ea1ace 100644 --- a/std/math/cos.zig +++ b/std/math/cos.zig @@ -4,8 +4,9 @@ // - cos(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn cos(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/cosh.zig b/std/math/cosh.zig index 6d40d71b8..05565d6b3 100644 --- a/std/math/cosh.zig +++ b/std/math/cosh.zig @@ -5,9 +5,10 @@ // - cosh(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); +const std = @import("../index.zig"); +const math = std.math; const expo2 = @import("expo2.zig").expo2; -const assert = @import("../debug.zig").assert; +const assert = std.debug.assert; pub fn cosh(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/exp.zig b/std/math/exp.zig index 6e591daea..4cce18ffe 100644 --- a/std/math/exp.zig +++ b/std/math/exp.zig @@ -3,8 +3,9 @@ // - exp(+inf) = +inf // - exp(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn exp(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/exp2.zig b/std/math/exp2.zig index 6061f3239..4ce7de909 100644 --- a/std/math/exp2.zig +++ b/std/math/exp2.zig @@ -3,8 +3,9 @@ // - exp2(+inf) = +inf // - exp2(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn exp2(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/expm1.zig b/std/math/expm1.zig index fbe184103..10670c4cf 100644 --- a/std/math/expm1.zig +++ b/std/math/expm1.zig @@ -4,8 +4,9 @@ // - expm1(-inf) = -1 // - expm1(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn expm1(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/fabs.zig b/std/math/fabs.zig index cf1b8f1f1..dc1184dcc 100644 --- a/std/math/fabs.zig +++ b/std/math/fabs.zig @@ -3,8 +3,9 @@ // - fabs(+-inf) = +inf // - fabs(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn fabs(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/floor.zig b/std/math/floor.zig index d7de45e9d..910dfd190 100644 --- a/std/math/floor.zig +++ b/std/math/floor.zig @@ -5,8 +5,9 @@ // - floor(nan) = nan const builtin = @import("builtin"); -const assert = @import("../debug.zig").assert; -const math = @import("index.zig"); +const assert = std.debug.assert; +const std = @import("../index.zig"); +const math = std.math; pub fn floor(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/fma.zig b/std/math/fma.zig index 8e5adc80b..b48cfc83b 100644 --- a/std/math/fma.zig +++ b/std/math/fma.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn fma(comptime T: type, x: T, y: T, z: T) -> T { return switch (T) { diff --git a/std/math/frexp.zig b/std/math/frexp.zig index 1a317a2c8..a90121e5f 100644 --- a/std/math/frexp.zig +++ b/std/math/frexp.zig @@ -4,8 +4,9 @@ // - frexp(+-inf) = +-inf, 0 // - frexp(nan) = nan, undefined -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; fn frexp_result(comptime T: type) -> type { return struct { diff --git a/std/math/hypot.zig b/std/math/hypot.zig index 9b09ed53a..6c0039b17 100644 --- a/std/math/hypot.zig +++ b/std/math/hypot.zig @@ -5,8 +5,9 @@ // - hypot(nan, y) = nan // - hypot(x, nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn hypot(comptime T: type, x: T, y: T) -> T { return switch (T) { diff --git a/std/math/ilogb.zig b/std/math/ilogb.zig index 41a1e2d83..db8e24d6c 100644 --- a/std/math/ilogb.zig +++ b/std/math/ilogb.zig @@ -4,8 +4,9 @@ // - ilogb(0) = @maxValue(i32) // - ilogb(nan) = @maxValue(i32) -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn ilogb(x: var) -> i32 { const T = @typeOf(x); diff --git a/std/math/index.zig b/std/math/index.zig index 1991864f6..d38215405 100644 --- a/std/math/index.zig +++ b/std/math/index.zig @@ -1,6 +1,7 @@ const builtin = @import("builtin"); +const std = @import("../index.zig"); const TypeId = builtin.TypeId; -const assert = @import("../debug.zig").assert; +const assert = std.debug.assert; pub const e = 2.71828182845904523536028747135266249775724709369995; pub const pi = 3.14159265358979323846264338327950288419716939937510; diff --git a/std/math/inf.zig b/std/math/inf.zig index 546e6f3af..b253124c8 100644 --- a/std/math/inf.zig +++ b/std/math/inf.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn inf(comptime T: type) -> T { return switch (T) { diff --git a/std/math/isfinite.zig b/std/math/isfinite.zig index d44d373cf..67fcf3cd1 100644 --- a/std/math/isfinite.zig +++ b/std/math/isfinite.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn isFinite(x: var) -> bool { const T = @typeOf(x); diff --git a/std/math/isinf.zig b/std/math/isinf.zig index 98c90e72a..75529fbb5 100644 --- a/std/math/isinf.zig +++ b/std/math/isinf.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn isInf(x: var) -> bool { const T = @typeOf(x); diff --git a/std/math/isnan.zig b/std/math/isnan.zig index e996a7269..d494dddca 100644 --- a/std/math/isnan.zig +++ b/std/math/isnan.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn isNan(x: var) -> bool { const T = @typeOf(x); diff --git a/std/math/isnormal.zig b/std/math/isnormal.zig index f815c2680..4d07bf4cb 100644 --- a/std/math/isnormal.zig +++ b/std/math/isnormal.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn isNormal(x: var) -> bool { const T = @typeOf(x); diff --git a/std/math/ln.zig b/std/math/ln.zig index 4ded89d32..c5a5c9384 100644 --- a/std/math/ln.zig +++ b/std/math/ln.zig @@ -5,8 +5,9 @@ // - ln(x) = nan if x < 0 // - ln(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; const builtin = @import("builtin"); const TypeId = builtin.TypeId; diff --git a/std/math/log.zig b/std/math/log.zig index 1ff226f7e..4edb77bb1 100644 --- a/std/math/log.zig +++ b/std/math/log.zig @@ -1,7 +1,8 @@ -const math = @import("index.zig"); +const std = @import("../index.zig"); +const math = std.math; const builtin = @import("builtin"); const TypeId = builtin.TypeId; -const assert = @import("../debug.zig").assert; +const assert = std.debug.assert; pub fn log(comptime T: type, base: T, x: T) -> T { if (base == 2) { diff --git a/std/math/log10.zig b/std/math/log10.zig index 73168dec8..0b6fc31aa 100644 --- a/std/math/log10.zig +++ b/std/math/log10.zig @@ -5,8 +5,9 @@ // - log10(x) = nan if x < 0 // - log10(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; const builtin = @import("builtin"); const TypeId = builtin.TypeId; diff --git a/std/math/log1p.zig b/std/math/log1p.zig index b36938503..ce5aad1d8 100644 --- a/std/math/log1p.zig +++ b/std/math/log1p.zig @@ -6,8 +6,9 @@ // - log1p(x) = nan if x < -1 // - log1p(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn log1p(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/log2.zig b/std/math/log2.zig index 1b38a9ece..a9789e47c 100644 --- a/std/math/log2.zig +++ b/std/math/log2.zig @@ -5,8 +5,9 @@ // - log2(x) = nan if x < 0 // - log2(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; const builtin = @import("builtin"); const TypeId = builtin.TypeId; diff --git a/std/math/modf.zig b/std/math/modf.zig index 72730b67d..dc17f35b5 100644 --- a/std/math/modf.zig +++ b/std/math/modf.zig @@ -3,8 +3,9 @@ // - modf(+-inf) = +-inf, nan // - modf(nan) = nan, nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; fn modf_result(comptime T: type) -> type { return struct { diff --git a/std/math/pow.zig b/std/math/pow.zig index 55a2cd8c3..b21fb3a92 100644 --- a/std/math/pow.zig +++ b/std/math/pow.zig @@ -22,8 +22,9 @@ // pow(x, y) = nan for finite x < 0 and finite non-integer y const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; // This implementation is taken from the go stlib, musl is a bit more complex. pub fn pow(comptime T: type, x: T, y: T) -> T { diff --git a/std/math/round.zig b/std/math/round.zig index 1e193fb1d..3abee040e 100644 --- a/std/math/round.zig +++ b/std/math/round.zig @@ -5,8 +5,9 @@ // - round(nan) = nan const builtin = @import("builtin"); -const assert = @import("../debug.zig").assert; -const math = @import("index.zig"); +const assert = std.debug.assert; +const std = @import("../index.zig"); +const math = std.math; pub fn round(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/scalbn.zig b/std/math/scalbn.zig index 0be6a3d47..6d1c77659 100644 --- a/std/math/scalbn.zig +++ b/std/math/scalbn.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn scalbn(x: var, n: i32) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/signbit.zig b/std/math/signbit.zig index b8ccecfa1..b9bfe818d 100644 --- a/std/math/signbit.zig +++ b/std/math/signbit.zig @@ -1,5 +1,6 @@ -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn signbit(x: var) -> bool { const T = @typeOf(x); diff --git a/std/math/sin.zig b/std/math/sin.zig index 392bef1bc..99008af46 100644 --- a/std/math/sin.zig +++ b/std/math/sin.zig @@ -5,8 +5,9 @@ // - sin(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn sin(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/sinh.zig b/std/math/sinh.zig index 4c575f10e..ca06bc615 100644 --- a/std/math/sinh.zig +++ b/std/math/sinh.zig @@ -5,8 +5,9 @@ // - sinh(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; const expo2 = @import("expo2.zig").expo2; pub fn sinh(x: var) -> @typeOf(x) { diff --git a/std/math/sqrt.zig b/std/math/sqrt.zig index 263e61661..4d84756b4 100644 --- a/std/math/sqrt.zig +++ b/std/math/sqrt.zig @@ -5,8 +5,9 @@ // - sqrt(x) = nan if x < 0 // - sqrt(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; const builtin = @import("builtin"); const TypeId = builtin.TypeId; diff --git a/std/math/tan.zig b/std/math/tan.zig index ff53a758b..e62e9b889 100644 --- a/std/math/tan.zig +++ b/std/math/tan.zig @@ -5,8 +5,9 @@ // - tan(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn tan(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/math/tanh.zig b/std/math/tanh.zig index 771502936..813b4f456 100644 --- a/std/math/tanh.zig +++ b/std/math/tanh.zig @@ -5,8 +5,9 @@ // - sinh(nan) = nan const builtin = @import("builtin"); -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; const expo2 = @import("expo2.zig").expo2; pub fn tanh(x: var) -> @typeOf(x) { diff --git a/std/math/trunc.zig b/std/math/trunc.zig index 81eacb30b..1d9032a22 100644 --- a/std/math/trunc.zig +++ b/std/math/trunc.zig @@ -4,8 +4,9 @@ // - trunc(+-inf) = +-inf // - trunc(nan) = nan -const math = @import("index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const math = std.math; +const assert = std.debug.assert; pub fn trunc(x: var) -> @typeOf(x) { const T = @typeOf(x); diff --git a/std/mem.zig b/std/mem.zig index 7438eba70..41a4155b6 100644 --- a/std/mem.zig +++ b/std/mem.zig @@ -1,6 +1,7 @@ -const debug = @import("debug.zig"); +const std = @import("index.zig"); +const debug = std.debug; const assert = debug.assert; -const math = @import("math/index.zig"); +const math = std.math; const builtin = @import("builtin"); error OutOfMemory; diff --git a/std/net.zig b/std/net.zig index a5fd4d603..da078eab3 100644 --- a/std/net.zig +++ b/std/net.zig @@ -1,6 +1,7 @@ -const linux = @import("os/linux.zig"); -const assert = @import("debug.zig").assert; -const endian = @import("endian.zig"); +const std = @import("index.zig"); +const linux = std.os.linux; +const assert = std.debug.assert; +const endian = std.endian; error SigInterrupt; error Io; diff --git a/std/os/darwin.zig b/std/os/darwin.zig index e230826b7..7e3e5e823 100644 --- a/std/os/darwin.zig +++ b/std/os/darwin.zig @@ -1,5 +1,6 @@ -const c = @import("../c/index.zig"); -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const c = std.c; +const assert = std.debug.assert; pub use @import("darwin_errno.zig"); diff --git a/std/os/index.zig b/std/os/index.zig index 8e79eda40..0fd3f02e9 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -1,3 +1,4 @@ +const std = @import("../index.zig"); const builtin = @import("builtin"); const Os = builtin.Os; const is_windows = builtin.os == Os.windows; @@ -37,22 +38,22 @@ pub const createWindowsEnvBlock = windows_util.createWindowsEnvBlock; pub const FileHandle = if (is_windows) windows.HANDLE else i32; -const debug = @import("../debug.zig"); +const debug = std.debug; const assert = debug.assert; -const c = @import("../c/index.zig"); +const c = std.c; -const mem = @import("../mem.zig"); +const mem = std.mem; const Allocator = mem.Allocator; -const BufMap = @import("../buf_map.zig").BufMap; -const cstr = @import("../cstr.zig"); +const BufMap = std.BufMap; +const cstr = std.cstr; -const io = @import("../io.zig"); -const base64 = @import("../base64.zig"); -const ArrayList = @import("../array_list.zig").ArrayList; -const Buffer = @import("../buffer.zig").Buffer; -const math = @import("../index.zig").math; +const io = std.io; +const base64 = std.base64; +const ArrayList = std.ArrayList; +const Buffer = std.Buffer; +const math = std.math; error SystemResources; error AccessDenied; diff --git a/std/os/linux.zig b/std/os/linux.zig index f9baa4309..c254f83d1 100644 --- a/std/os/linux.zig +++ b/std/os/linux.zig @@ -1,4 +1,5 @@ -const assert = @import("../debug.zig").assert; +const std = @import("../index.zig"); +const assert = std.debug.assert; const builtin = @import("builtin"); const arch = switch (builtin.arch) { builtin.Arch.x86_64 => @import("linux_x86_64.zig"), diff --git a/std/os/path.zig b/std/os/path.zig index db514add9..9417cb429 100644 --- a/std/os/path.zig +++ b/std/os/path.zig @@ -1,16 +1,16 @@ +const std = @import("../index.zig"); const builtin = @import("builtin"); const Os = builtin.Os; -const debug = @import("../debug.zig"); +const debug = std.debug; const assert = debug.assert; -const mem = @import("../mem.zig"); -const fmt = @import("../fmt/index.zig"); +const mem = std.mem; +const fmt = std.fmt; const Allocator = mem.Allocator; -const os = @import("index.zig"); -const math = @import("../math/index.zig"); +const os = std.os; +const math = std.math; const posix = os.posix; const windows = os.windows; -const c = @import("../c/index.zig"); -const cstr = @import("../cstr.zig"); +const cstr = std.cstr; pub const sep_windows = '\\'; pub const sep_posix = '/'; diff --git a/std/rand.zig b/std/rand.zig index 73801a078..f35229ea3 100644 --- a/std/rand.zig +++ b/std/rand.zig @@ -1,8 +1,9 @@ +const std = @import("index.zig"); const builtin = @import("builtin"); -const assert = @import("debug.zig").assert; +const assert = std.debug.assert; const rand_test = @import("rand_test.zig"); -const mem = @import("mem.zig"); -const math = @import("math/index.zig"); +const mem = std.mem; +const math = std.math; pub const MT19937_32 = MersenneTwister( u32, 624, 397, 31, diff --git a/std/special/compiler_rt/fixunsdfdi_test.zig b/std/special/compiler_rt/fixunsdfdi_test.zig index cb4a52b9e..2a0e778ba 100644 --- a/std/special/compiler_rt/fixunsdfdi_test.zig +++ b/std/special/compiler_rt/fixunsdfdi_test.zig @@ -1,5 +1,5 @@ const __fixunsdfdi = @import("fixunsdfdi.zig").__fixunsdfdi; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunsdfdi(a: f64, expected: u64) { const x = __fixunsdfdi(a); diff --git a/std/special/compiler_rt/fixunsdfsi_test.zig b/std/special/compiler_rt/fixunsdfsi_test.zig index eef374773..611639139 100644 --- a/std/special/compiler_rt/fixunsdfsi_test.zig +++ b/std/special/compiler_rt/fixunsdfsi_test.zig @@ -1,5 +1,5 @@ const __fixunsdfsi = @import("fixunsdfsi.zig").__fixunsdfsi; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunsdfsi(a: f64, expected: u32) { const x = __fixunsdfsi(a); diff --git a/std/special/compiler_rt/fixunsdfti_test.zig b/std/special/compiler_rt/fixunsdfti_test.zig index cd348fffd..dc7f1c29c 100644 --- a/std/special/compiler_rt/fixunsdfti_test.zig +++ b/std/special/compiler_rt/fixunsdfti_test.zig @@ -1,5 +1,5 @@ const __fixunsdfti = @import("fixunsdfti.zig").__fixunsdfti; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunsdfti(a: f64, expected: u128) { const x = __fixunsdfti(a); diff --git a/std/special/compiler_rt/fixunssfdi_test.zig b/std/special/compiler_rt/fixunssfdi_test.zig index 67e3cd24c..41827a083 100644 --- a/std/special/compiler_rt/fixunssfdi_test.zig +++ b/std/special/compiler_rt/fixunssfdi_test.zig @@ -1,5 +1,5 @@ const __fixunssfdi = @import("fixunssfdi.zig").__fixunssfdi; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunssfdi(a: f32, expected: u64) { const x = __fixunssfdi(a); diff --git a/std/special/compiler_rt/fixunssfsi_test.zig b/std/special/compiler_rt/fixunssfsi_test.zig index bdb033933..664c02ea7 100644 --- a/std/special/compiler_rt/fixunssfsi_test.zig +++ b/std/special/compiler_rt/fixunssfsi_test.zig @@ -1,5 +1,5 @@ const __fixunssfsi = @import("fixunssfsi.zig").__fixunssfsi; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunssfsi(a: f32, expected: u32) { const x = __fixunssfsi(a); diff --git a/std/special/compiler_rt/fixunssfti_test.zig b/std/special/compiler_rt/fixunssfti_test.zig index aaa7c70ab..712df893c 100644 --- a/std/special/compiler_rt/fixunssfti_test.zig +++ b/std/special/compiler_rt/fixunssfti_test.zig @@ -1,5 +1,5 @@ const __fixunssfti = @import("fixunssfti.zig").__fixunssfti; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunssfti(a: f32, expected: u128) { const x = __fixunssfti(a); diff --git a/std/special/compiler_rt/fixunstfdi_test.zig b/std/special/compiler_rt/fixunstfdi_test.zig index c33062fad..b5526f62a 100644 --- a/std/special/compiler_rt/fixunstfdi_test.zig +++ b/std/special/compiler_rt/fixunstfdi_test.zig @@ -1,5 +1,5 @@ const __fixunstfdi = @import("fixunstfdi.zig").__fixunstfdi; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunstfdi(a: f128, expected: u64) { const x = __fixunstfdi(a); diff --git a/std/special/compiler_rt/fixunstfsi_test.zig b/std/special/compiler_rt/fixunstfsi_test.zig index 87bb1b9fa..74b3507c4 100644 --- a/std/special/compiler_rt/fixunstfsi_test.zig +++ b/std/special/compiler_rt/fixunstfsi_test.zig @@ -1,5 +1,5 @@ const __fixunstfsi = @import("fixunstfsi.zig").__fixunstfsi; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunstfsi(a: f128, expected: u32) { const x = __fixunstfsi(a); diff --git a/std/special/compiler_rt/fixunstfti_test.zig b/std/special/compiler_rt/fixunstfti_test.zig index f18c39d04..a6c9ea0f6 100644 --- a/std/special/compiler_rt/fixunstfti_test.zig +++ b/std/special/compiler_rt/fixunstfti_test.zig @@ -1,5 +1,5 @@ const __fixunstfti = @import("fixunstfti.zig").__fixunstfti; -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; fn test__fixunstfti(a: f128, expected: u128) { const x = __fixunstfti(a); diff --git a/std/special/compiler_rt/index.zig b/std/special/compiler_rt/index.zig index fab7b7c87..5034a6fd9 100644 --- a/std/special/compiler_rt/index.zig +++ b/std/special/compiler_rt/index.zig @@ -68,7 +68,7 @@ comptime { } } -const assert = @import("../../debug.zig").assert; +const assert = @import("../../index.zig").debug.assert; const __udivmoddi4 = @import("udivmoddi4.zig").__udivmoddi4;