mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
Sema: replace backticks with single quotes
Most error messages already use single quotes for everything so this makes the remaining ones consistent.
This commit is contained in:
parent
a9785fe8ee
commit
fe4ea31f7e
10
src/Sema.zig
10
src/Sema.zig
@ -3294,7 +3294,7 @@ fn ensureResultUsed(
|
||||
const msg = msg: {
|
||||
const msg = try sema.errMsg(block, src, "error is ignored", .{});
|
||||
errdefer msg.destroy(sema.gpa);
|
||||
try sema.errNote(block, src, msg, "consider using `try`, `catch`, or `if`", .{});
|
||||
try sema.errNote(block, src, msg, "consider using 'try', 'catch', or 'if'", .{});
|
||||
break :msg msg;
|
||||
};
|
||||
return sema.failWithOwnedErrorMsg(msg);
|
||||
@ -3325,7 +3325,7 @@ fn zirEnsureResultNonError(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
|
||||
const msg = msg: {
|
||||
const msg = try sema.errMsg(block, src, "error is discarded", .{});
|
||||
errdefer msg.destroy(sema.gpa);
|
||||
try sema.errNote(block, src, msg, "consider using `try`, `catch`, or `if`", .{});
|
||||
try sema.errNote(block, src, msg, "consider using 'try', 'catch', or 'if'", .{});
|
||||
break :msg msg;
|
||||
};
|
||||
return sema.failWithOwnedErrorMsg(msg);
|
||||
@ -8477,7 +8477,7 @@ fn handleExternLibName(
|
||||
return sema.fail(
|
||||
block,
|
||||
src_loc,
|
||||
"dependency on dynamic library '{s}' requires enabling Position Independent Code. Fixed by `-l{s}` or `-fPIC`.",
|
||||
"dependency on dynamic library '{s}' requires enabling Position Independent Code. Fixed by '-l{s}' or '-fPIC'.",
|
||||
.{ lib_name, lib_name },
|
||||
);
|
||||
}
|
||||
@ -25150,7 +25150,7 @@ fn coerceExtra(
|
||||
(try sema.coerceInMemoryAllowed(block, inst_ty.errorUnionPayload(), dest_ty, false, target, dest_ty_src, inst_src)) == .ok)
|
||||
{
|
||||
try sema.errNote(block, inst_src, msg, "cannot convert error union to payload type", .{});
|
||||
try sema.errNote(block, inst_src, msg, "consider using `try`, `catch`, or `if`", .{});
|
||||
try sema.errNote(block, inst_src, msg, "consider using 'try', 'catch', or 'if'", .{});
|
||||
}
|
||||
|
||||
// ?T to T
|
||||
@ -25159,7 +25159,7 @@ fn coerceExtra(
|
||||
(try sema.coerceInMemoryAllowed(block, inst_ty.optionalChild(&buf), dest_ty, false, target, dest_ty_src, inst_src)) == .ok)
|
||||
{
|
||||
try sema.errNote(block, inst_src, msg, "cannot convert optional to payload type", .{});
|
||||
try sema.errNote(block, inst_src, msg, "consider using `.?`, `orelse`, or `if`", .{});
|
||||
try sema.errNote(block, inst_src, msg, "consider using '.?', 'orelse', or 'if'", .{});
|
||||
}
|
||||
|
||||
try in_memory_result.report(sema, block, inst_src, msg);
|
||||
|
||||
@ -20,4 +20,4 @@ export fn entry() void {
|
||||
//
|
||||
// :11:27: error: expected type 'u8', found '?u8'
|
||||
// :11:27: note: cannot convert optional to payload type
|
||||
// :11:27: note: consider using `.?`, `orelse`, or `if`
|
||||
// :11:27: note: consider using '.?', 'orelse', or 'if'
|
||||
|
||||
@ -10,4 +10,4 @@ fn foo() !void {
|
||||
// target=native
|
||||
//
|
||||
// :2:12: error: error is discarded
|
||||
// :2:12: note: consider using `try`, `catch`, or `if`
|
||||
// :2:12: note: consider using 'try', 'catch', or 'if'
|
||||
|
||||
@ -26,7 +26,7 @@ export fn quux() u32 {
|
||||
// :11:15: error: expected type 'u32', found '@typeInfo(@typeInfo(@TypeOf(tmp.bar)).Fn.return_type.?).ErrorUnion.error_set!u32'
|
||||
// :10:17: note: function cannot return an error
|
||||
// :11:15: note: cannot convert error union to payload type
|
||||
// :11:15: note: consider using `try`, `catch`, or `if`
|
||||
// :11:15: note: consider using 'try', 'catch', or 'if'
|
||||
// :15:14: error: expected type 'u32', found '@typeInfo(@typeInfo(@TypeOf(tmp.bar)).Fn.return_type.?).ErrorUnion.error_set!u32'
|
||||
// :15:14: note: cannot convert error union to payload type
|
||||
// :15:14: note: consider using `try`, `catch`, or `if`
|
||||
// :15:14: note: consider using 'try', 'catch', or 'if'
|
||||
|
||||
@ -8,4 +8,4 @@ fn bar() anyerror!i32 { return 0; }
|
||||
// target=native
|
||||
//
|
||||
// :2:14: error: error is ignored
|
||||
// :2:14: note: consider using `try`, `catch`, or `if`
|
||||
// :2:14: note: consider using 'try', 'catch', or 'if'
|
||||
|
||||
@ -18,8 +18,8 @@ fn bad() anyerror!void {
|
||||
// target=native
|
||||
//
|
||||
// :2:24: error: error is ignored
|
||||
// :2:24: note: consider using `try`, `catch`, or `if`
|
||||
// :2:24: note: consider using 'try', 'catch', or 'if'
|
||||
// :6:25: error: error is ignored
|
||||
// :6:25: note: consider using `try`, `catch`, or `if`
|
||||
// :6:25: note: consider using 'try', 'catch', or 'if'
|
||||
// :10:25: error: error is ignored
|
||||
// :10:25: note: consider using `try`, `catch`, or `if`
|
||||
// :10:25: note: consider using 'try', 'catch', or 'if'
|
||||
|
||||
@ -10,5 +10,5 @@ export fn foo() void {
|
||||
//
|
||||
// :4:9: error: expected type '*anyopaque', found '?*anyopaque'
|
||||
// :4:9: note: cannot convert optional to payload type
|
||||
// :4:9: note: consider using `.?`, `orelse`, or `if`
|
||||
// :4:9: note: consider using '.?', 'orelse', or 'if'
|
||||
// :4:9: note: '?*anyopaque' could have null values which are illegal in type '*anyopaque'
|
||||
|
||||
@ -20,4 +20,4 @@ export fn entry() void {
|
||||
//
|
||||
// :12:25: error: expected type 'u32', found '@typeInfo(@typeInfo(@TypeOf(tmp.get_uval)).Fn.return_type.?).ErrorUnion.error_set!u32'
|
||||
// :12:25: note: cannot convert error union to payload type
|
||||
// :12:25: note: consider using `try`, `catch`, or `if`
|
||||
// :12:25: note: consider using 'try', 'catch', or 'if'
|
||||
|
||||
@ -17,4 +17,4 @@ pub const Container = struct {
|
||||
//
|
||||
// :3:36: error: expected type 'i32', found '?i32'
|
||||
// :3:36: note: cannot convert optional to payload type
|
||||
// :3:36: note: consider using `.?`, `orelse`, or `if`
|
||||
// :3:36: note: consider using '.?', 'orelse', or 'if'
|
||||
|
||||
@ -17,4 +17,4 @@ pub const Container = struct {
|
||||
//
|
||||
// :3:36: error: expected type 'i32', found '?i32'
|
||||
// :3:36: note: cannot convert optional to payload type
|
||||
// :3:36: note: consider using `.?`, `orelse`, or `if`
|
||||
// :3:36: note: consider using '.?', 'orelse', or 'if'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user