| ... | ... | @@ -3039,10 +3039,10 @@ test "basic slices" { |
| 3039 | 3039 | const array_ptr_len = array[runtime_start..][0..length]; |
| 3040 | 3040 | try expect(@TypeOf(array_ptr_len) == *[length]i32); |
| 3041 | 3041 | |
| 3042 | | // Using the address-of operator on a slice gives a single-item pointer, |
| 3043 | | // while using the `ptr` field gives a many-item pointer. |
| 3044 | | try expect(@TypeOf(slice.ptr) == [*]i32); |
| 3042 | // Using the address-of operator on a slice gives a single-item pointer. |
| 3045 | 3043 | try expect(@TypeOf(&slice[0]) == *i32); |
| 3044 | // Using the `ptr` field gives a many-item pointer. |
| 3045 | try expect(@TypeOf(slice.ptr) == [*]i32); |
| 3046 | 3046 | try expect(@intFromPtr(slice.ptr) == @intFromPtr(&slice[0])); |
| 3047 | 3047 | |
| 3048 | 3048 | // Slices have array bounds checking. If you try to access something out |