Sema: fix error location when casting pointer to slice
Co-authored-by: Veikka Tuominen <git@vexu.eu>
This commit is contained in:
committed by
Veikka Tuominen
parent
3234e8de3a
commit
6672921e32
@@ -27202,7 +27202,7 @@ fn analyzeSlice(
|
||||
if (!end_is_len) {
|
||||
break :e try sema.coerce(block, Type.usize, uncasted_end_opt, end_src);
|
||||
}
|
||||
return sema.fail(block, end_src, "slice of pointer must include end value", .{});
|
||||
return sema.fail(block, src, "slice of pointer must include end value", .{});
|
||||
};
|
||||
|
||||
const sentinel = s: {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
comptime {
|
||||
var ptr: [*]u8 = undefined;
|
||||
_ = ptr[0..];
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :3:12: error: slice of pointer must include end value
|
||||
Reference in New Issue
Block a user