mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
langref: order comment to align with code example
This commit is contained in:
parent
2b58978360
commit
25a556107c
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue