authorgravatar for mitchell.hashimoto@gmail.comMitchell Hashimoto <mitchell.hashimoto@gmail.com> 2022-03-03 11:04:04-08:00
committergravatar for mitchell.hashimoto@gmail.comMitchell Hashimoto <mitchell.hashimoto@gmail.com> 2022-03-03 11:04:04-08:00
log0924f17a234c48c4a7a17e44a1ffac6a9026d5e5
treef6381f3f3e80bab71c88867b6461da9059f67304
parent65943010c70b33e711a038dff5f80066045ee1b7
signaturelock-open Commit is signed but in an unrecognized format.

stage2: peer resolve const u8 slices correctly


2 files changed, 7 insertions(+), 3 deletions(-)

src/Sema.zig+2-2
......@@ -18230,7 +18230,7 @@ fn resolvePeerTypes(
1823018230 convert_to_slice = false; // it already is a slice
1823118231
1823218232 // If the pointer is const then we need to const
18233 if (candidate_ty.childType().isConstPtr())
18233 if (candidate_ty.isConstPtr())
1823418234 seen_const = true;
1823518235
1823618236 continue;
......@@ -18253,7 +18253,7 @@ fn resolvePeerTypes(
1825318253 convert_to_slice = false; // it already is a slice
1825418254
1825518255 // If the prev pointer is const then we need to const
18256 if (chosen_child_ty.isConstPtr())
18256 if (chosen_ty.isConstPtr())
1825718257 seen_const = true;
1825818258
1825918259 continue;
test/behavior/cast.zig+5-1
......@@ -964,7 +964,11 @@ test "cast between C pointer with different but compatible types" {
964964}
965965
966966test "peer type resolve string lit with sentinel-terminated mutable slice" {
967 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
967 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
968 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
969 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
970 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
971 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
968972
969973 var array: [4:0]u8 = undefined;
970974 array[4] = 0; // TODO remove this when #4372 is solved