authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-27 16:04:58+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-30 15:20:16+02:00
logfe4ea31f7e9e1c8caea6a1df107b91e8ea1a7b8a
tree09f58d195c9b6efcea57343cd5a184517fe7a812
parenta9785fe8eef564011b4266e8a1b9aa15b7e37189

Sema: replace backticks with single quotes

Most error messages already use single quotes for everything so this makes the remaining ones consistent.

10 files changed, 17 insertions(+), 17 deletions(-)

src/Sema.zig+5-5
......@@ -3294,7 +3294,7 @@ fn ensureResultUsed(
32943294 const msg = msg: {
32953295 const msg = try sema.errMsg(block, src, "error is ignored", .{});
32963296 errdefer msg.destroy(sema.gpa);
3297 try sema.errNote(block, src, msg, "consider using `try`, `catch`, or `if`", .{});
3297 try sema.errNote(block, src, msg, "consider using 'try', 'catch', or 'if'", .{});
32983298 break :msg msg;
32993299 };
33003300 return sema.failWithOwnedErrorMsg(msg);
......@@ -3325,7 +3325,7 @@ fn zirEnsureResultNonError(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
33253325 const msg = msg: {
33263326 const msg = try sema.errMsg(block, src, "error is discarded", .{});
33273327 errdefer msg.destroy(sema.gpa);
3328 try sema.errNote(block, src, msg, "consider using `try`, `catch`, or `if`", .{});
3328 try sema.errNote(block, src, msg, "consider using 'try', 'catch', or 'if'", .{});
33293329 break :msg msg;
33303330 };
33313331 return sema.failWithOwnedErrorMsg(msg);
......@@ -8477,7 +8477,7 @@ fn handleExternLibName(
84778477 return sema.fail(
84788478 block,
84798479 src_loc,
8480 "dependency on dynamic library '{s}' requires enabling Position Independent Code. Fixed by `-l{s}` or `-fPIC`.",
8480 "dependency on dynamic library '{s}' requires enabling Position Independent Code. Fixed by '-l{s}' or '-fPIC'.",
84818481 .{ lib_name, lib_name },
84828482 );
84838483 }
......@@ -25150,7 +25150,7 @@ fn coerceExtra(
2515025150 (try sema.coerceInMemoryAllowed(block, inst_ty.errorUnionPayload(), dest_ty, false, target, dest_ty_src, inst_src)) == .ok)
2515125151 {
2515225152 try sema.errNote(block, inst_src, msg, "cannot convert error union to payload type", .{});
25153 try sema.errNote(block, inst_src, msg, "consider using `try`, `catch`, or `if`", .{});
25153 try sema.errNote(block, inst_src, msg, "consider using 'try', 'catch', or 'if'", .{});
2515425154 }
2515525155
2515625156 // ?T to T
......@@ -25159,7 +25159,7 @@ fn coerceExtra(
2515925159 (try sema.coerceInMemoryAllowed(block, inst_ty.optionalChild(&buf), dest_ty, false, target, dest_ty_src, inst_src)) == .ok)
2516025160 {
2516125161 try sema.errNote(block, inst_src, msg, "cannot convert optional to payload type", .{});
25162 try sema.errNote(block, inst_src, msg, "consider using `.?`, `orelse`, or `if`", .{});
25162 try sema.errNote(block, inst_src, msg, "consider using '.?', 'orelse', or 'if'", .{});
2516325163 }
2516425164
2516525165 try in_memory_result.report(sema, block, inst_src, msg);
test/cases/compile_errors/assigning_to_struct_or_union_fields_that_are_not_optionals_with_a_function_that_returns_an_optional.zig+1-1
......@@ -20,4 +20,4 @@ export fn entry() void {
2020//
2121// :11:27: error: expected type 'u8', found '?u8'
2222// :11:27: note: cannot convert optional to payload type
23// :11:27: note: consider using `.?`, `orelse`, or `if`
23// :11:27: note: consider using '.?', 'orelse', or 'if'
test/cases/compile_errors/discarding_error_value.zig+1-1
......@@ -10,4 +10,4 @@ fn foo() !void {
1010// target=native
1111//
1212// :2:12: error: error is discarded
13// :2:12: note: consider using `try`, `catch`, or `if`
13// :2:12: note: consider using 'try', 'catch', or 'if'
test/cases/compile_errors/helpful_return_type_error_message.zig+2-2
......@@ -26,7 +26,7 @@ export fn quux() u32 {
2626// :11:15: error: expected type 'u32', found '@typeInfo(@typeInfo(@TypeOf(tmp.bar)).Fn.return_type.?).ErrorUnion.error_set!u32'
2727// :10:17: note: function cannot return an error
2828// :11:15: note: cannot convert error union to payload type
29// :11:15: note: consider using `try`, `catch`, or `if`
29// :11:15: note: consider using 'try', 'catch', or 'if'
3030// :15:14: error: expected type 'u32', found '@typeInfo(@typeInfo(@TypeOf(tmp.bar)).Fn.return_type.?).ErrorUnion.error_set!u32'
3131// :15:14: note: cannot convert error union to payload type
32// :15:14: note: consider using `try`, `catch`, or `if`
32// :15:14: note: consider using 'try', 'catch', or 'if'
test/cases/compile_errors/ignored_deferred_function_call.zig+1-1
......@@ -8,4 +8,4 @@ fn bar() anyerror!i32 { return 0; }
88// target=native
99//
1010// :2:14: error: error is ignored
11// :2:14: note: consider using `try`, `catch`, or `if`
11// :2:14: note: consider using 'try', 'catch', or 'if'
test/cases/compile_errors/ignored_expression_in_while_continuation.zig+3-3
......@@ -18,8 +18,8 @@ fn bad() anyerror!void {
1818// target=native
1919//
2020// :2:24: error: error is ignored
21// :2:24: note: consider using `try`, `catch`, or `if`
21// :2:24: note: consider using 'try', 'catch', or 'if'
2222// :6:25: error: error is ignored
23// :6:25: note: consider using `try`, `catch`, or `if`
23// :6:25: note: consider using 'try', 'catch', or 'if'
2424// :10:25: error: error is ignored
25// :10:25: note: consider using `try`, `catch`, or `if`
25// :10:25: note: consider using 'try', 'catch', or 'if'
test/cases/compile_errors/issue_5618_coercion_of_optional_anyopaque_to_anyopaque_must_fail.zig+1-1
......@@ -10,5 +10,5 @@ export fn foo() void {
1010//
1111// :4:9: error: expected type '*anyopaque', found '?*anyopaque'
1212// :4:9: note: cannot convert optional to payload type
13// :4:9: note: consider using `.?`, `orelse`, or `if`
13// :4:9: note: consider using '.?', 'orelse', or 'if'
1414// :4:9: note: '?*anyopaque' could have null values which are illegal in type '*anyopaque'
test/cases/compile_errors/regression_test_2980_base_type_u32_is_not_type_checked_properly_when_assigning_a_value_within_a_struct.zig+1-1
......@@ -20,4 +20,4 @@ export fn entry() void {
2020//
2121// :12:25: error: expected type 'u32', found '@typeInfo(@typeInfo(@TypeOf(tmp.get_uval)).Fn.return_type.?).ErrorUnion.error_set!u32'
2222// :12:25: note: cannot convert error union to payload type
23// :12:25: note: consider using `try`, `catch`, or `if`
23// :12:25: note: consider using 'try', 'catch', or 'if'
test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr.zig+1-1
......@@ -17,4 +17,4 @@ pub const Container = struct {
1717//
1818// :3:36: error: expected type 'i32', found '?i32'
1919// :3:36: note: cannot convert optional to payload type
20// :3:36: note: consider using `.?`, `orelse`, or `if`
20// :3:36: note: consider using '.?', 'orelse', or 'if'
test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr_generic_call.zig+1-1
......@@ -17,4 +17,4 @@ pub const Container = struct {
1717//
1818// :3:36: error: expected type 'i32', found '?i32'
1919// :3:36: note: cannot convert optional to payload type
20// :3:36: note: consider using `.?`, `orelse`, or `if`
20// :3:36: note: consider using '.?', 'orelse', or 'if'