zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 25a556107cbd10cbddf530e633f70c688498d4e3 (tree)
parent 2b589783602c5428ecde9dbb3f41a81f85eb0f25
Author: Samuel Nevarez <35318078+samrock5000@users.noreply.github.com>
Date:   Mon,  1 Jan 2024 10:05:15 -0600

langref: order comment to align with code example
Diffstat:
Mdoc/langref.html.in | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/langref.html.in b/doc/langref.html.in @@ -3039,10 +3039,10 @@ test "basic slices" { const array_ptr_len = array[runtime_start..][0..length]; try expect(@TypeOf(array_ptr_len) == *[length]i32); - // Using the address-of operator on a slice gives a single-item pointer, - // while using the `ptr` field gives a many-item pointer. - try expect(@TypeOf(slice.ptr) == [*]i32); + // Using the address-of operator on a slice gives a single-item pointer. try expect(@TypeOf(&slice[0]) == *i32); + // Using the `ptr` field gives a many-item pointer. + try expect(@TypeOf(slice.ptr) == [*]i32); try expect(@intFromPtr(slice.ptr) == @intFromPtr(&slice[0])); // Slices have array bounds checking. If you try to access something out