Commit fe4ea31f7e

Veikka Tuominen <git@vexu.eu>
2023-01-27 15:04:58
Sema: replace backticks with single quotes
Most error messages already use single quotes for everything so this makes the remaining ones consistent.
1 parent a9785fe
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);
test/cases/compile_errors/assigning_to_struct_or_union_fields_that_are_not_optionals_with_a_function_that_returns_an_optional.zig
@@ -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'
test/cases/compile_errors/discarding_error_value.zig
@@ -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'
test/cases/compile_errors/helpful_return_type_error_message.zig
@@ -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'
test/cases/compile_errors/ignored_deferred_function_call.zig
@@ -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'
test/cases/compile_errors/ignored_expression_in_while_continuation.zig
@@ -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'
test/cases/compile_errors/issue_5618_coercion_of_optional_anyopaque_to_anyopaque_must_fail.zig
@@ -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'
test/cases/compile_errors/regression_test_2980_base_type_u32_is_not_type_checked_properly_when_assigning_a_value_within_a_struct.zig
@@ -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'
test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr.zig
@@ -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'
test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr_generic_call.zig
@@ -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'