Sema: add some missing apostrophes to error messages

This commit is contained in:
r00ster91 2023-04-29 16:00:22 +02:00
parent 1e9811070b
commit 743976ef48
3 changed files with 6 additions and 6 deletions

View File

@ -19910,7 +19910,7 @@ fn zirPtrCast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
return sema.failWithUseOfUndef(block, operand_src);
}
if (!dest_ty.ptrAllowsZero() and operand_val.isNull()) {
return sema.fail(block, operand_src, "null pointer casted to type {}", .{dest_ty.fmt(sema.mod)});
return sema.fail(block, operand_src, "null pointer casted to type '{}'", .{dest_ty.fmt(sema.mod)});
}
if (dest_ty.zigTypeTag() == .Optional and sema.typeOf(ptr).zigTypeTag() != .Optional) {
return sema.addConstant(dest_ty, try Value.Tag.opt_payload.create(sema.arena, operand_val));
@ -22013,10 +22013,10 @@ fn zirMemcpy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void
const msg = msg: {
const msg = try sema.errMsg(block, src, "unknown @memcpy length", .{});
errdefer msg.destroy(sema.gpa);
try sema.errNote(block, dest_src, msg, "destination type {} provides no length", .{
try sema.errNote(block, dest_src, msg, "destination type '{}' provides no length", .{
sema.typeOf(dest_ptr).fmt(sema.mod),
});
try sema.errNote(block, src_src, msg, "source type {} provides no length", .{
try sema.errNote(block, src_src, msg, "source type '{}' provides no length", .{
sema.typeOf(src_ptr).fmt(sema.mod),
});
break :msg msg;

View File

@ -8,4 +8,4 @@ comptime {
// backend=llvm
// target=native
//
// :3:32: error: null pointer casted to type *i32
// :3:32: error: null pointer casted to type '*i32'

View File

@ -25,8 +25,8 @@ pub export fn non_matching_lengths() void {
// target=native
//
// :5:5: error: unknown @memcpy length
// :5:18: note: destination type [*]u8 provides no length
// :5:24: note: source type [*]align(4) const u8 provides no length
// :5:18: note: destination type '[*]u8' provides no length
// :5:24: note: source type '[*]align(4) const u8' provides no length
// :10:13: error: type 'u8' does not support indexing
// :10:13: note: for loop operand must be an array, slice, tuple, or vector
// :15:13: error: type '*u8' does not support indexing