mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
stage2: peer resolve const u8 slices correctly
This commit is contained in:
parent
65943010c7
commit
0924f17a23
@ -18230,7 +18230,7 @@ fn resolvePeerTypes(
|
|||||||
convert_to_slice = false; // it already is a slice
|
convert_to_slice = false; // it already is a slice
|
||||||
|
|
||||||
// If the pointer is const then we need to const
|
// If the pointer is const then we need to const
|
||||||
if (candidate_ty.childType().isConstPtr())
|
if (candidate_ty.isConstPtr())
|
||||||
seen_const = true;
|
seen_const = true;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -18253,7 +18253,7 @@ fn resolvePeerTypes(
|
|||||||
convert_to_slice = false; // it already is a slice
|
convert_to_slice = false; // it already is a slice
|
||||||
|
|
||||||
// If the prev pointer is const then we need to const
|
// If the prev pointer is const then we need to const
|
||||||
if (chosen_child_ty.isConstPtr())
|
if (chosen_ty.isConstPtr())
|
||||||
seen_const = true;
|
seen_const = true;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -964,7 +964,11 @@ test "cast between C pointer with different but compatible types" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "peer type resolve string lit with sentinel-terminated mutable slice" {
|
test "peer type resolve string lit with sentinel-terminated mutable slice" {
|
||||||
if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
|
|
||||||
var array: [4:0]u8 = undefined;
|
var array: [4:0]u8 = undefined;
|
||||||
array[4] = 0; // TODO remove this when #4372 is solved
|
array[4] = 0; // TODO remove this when #4372 is solved
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user