diff --git a/src/Sema.zig b/src/Sema.zig index 712a684bf8628b1f5120ce7004e74452d4810d98..b4731d9509f6be0efcfdd5940943005a37e20caf 100644 --- a/src/Sema.zig +++ b/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); diff --git a/test/cases/compile_errors/assigning_to_struct_or_union_fields_that_are_not_optionals_with_a_function_that_returns_an_optional.zig b/test/cases/compile_errors/assigning_to_struct_or_union_fields_that_are_not_optionals_with_a_function_that_returns_an_optional.zig index 762eb284f2dffa682f5af382ec6cc14a9eeb88b4..530e5ffb746fe2ab96a9aaa234773878d704648b 100644 --- a/test/cases/compile_errors/assigning_to_struct_or_union_fields_that_are_not_optionals_with_a_function_that_returns_an_optional.zig +++ b/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' diff --git a/test/cases/compile_errors/discarding_error_value.zig b/test/cases/compile_errors/discarding_error_value.zig index 6dfe0be2313f1990ed166ce4d64ccdc7e535b014..c24d517d3e3b39133b0e1ec9af2a79239a24df89 100644 --- a/test/cases/compile_errors/discarding_error_value.zig +++ b/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' diff --git a/test/cases/compile_errors/helpful_return_type_error_message.zig b/test/cases/compile_errors/helpful_return_type_error_message.zig index b8e48036de78a8e026b5ce97b59e3ac926ae1dc6..871e9485372c950d496691a858ee3c687e5a2ef1 100644 --- a/test/cases/compile_errors/helpful_return_type_error_message.zig +++ b/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' diff --git a/test/cases/compile_errors/ignored_deferred_function_call.zig b/test/cases/compile_errors/ignored_deferred_function_call.zig index 05c4373705227b974529365be866124941b3737b..b318baa16cb563b01926c78a4261fe56ac63b9de 100644 --- a/test/cases/compile_errors/ignored_deferred_function_call.zig +++ b/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' diff --git a/test/cases/compile_errors/ignored_expression_in_while_continuation.zig b/test/cases/compile_errors/ignored_expression_in_while_continuation.zig index d7de0aac57809257a98d78e741801c3648b8d1b8..d108903c82189767de44dc831f4bae600feb3419 100644 --- a/test/cases/compile_errors/ignored_expression_in_while_continuation.zig +++ b/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' diff --git a/test/cases/compile_errors/issue_5618_coercion_of_optional_anyopaque_to_anyopaque_must_fail.zig b/test/cases/compile_errors/issue_5618_coercion_of_optional_anyopaque_to_anyopaque_must_fail.zig index f4716bc24d0012b8af21e112e2318c09681e0cda..95bba054b3afbc8b337d43e5ae630be740e6f07f 100644 --- a/test/cases/compile_errors/issue_5618_coercion_of_optional_anyopaque_to_anyopaque_must_fail.zig +++ b/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' diff --git a/test/cases/compile_errors/regression_test_2980_base_type_u32_is_not_type_checked_properly_when_assigning_a_value_within_a_struct.zig b/test/cases/compile_errors/regression_test_2980_base_type_u32_is_not_type_checked_properly_when_assigning_a_value_within_a_struct.zig index 09c496211a3dc8d104362c59144ffae986a4833a..1b951528bbb260bd14eaa5f2f9a5dd5dd519b1e1 100644 --- a/test/cases/compile_errors/regression_test_2980_base_type_u32_is_not_type_checked_properly_when_assigning_a_value_within_a_struct.zig +++ b/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' diff --git a/test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr.zig b/test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr.zig index cc1d2c976adb4622b3d8f9ef7ca81e68aff2e2f5..26c1a8d9cf348a385a172893c289a95d57cec84c 100644 --- a/test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr.zig +++ b/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' diff --git a/test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr_generic_call.zig b/test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr_generic_call.zig index 897675d44814490681dfa4ea2f6a3d3f08032146..471f9cca04d8f1b999ff6dcc1704831a9be187db 100644 --- a/test/cases/compile_errors/result_location_incompatibility_mismatching_handle_is_ptr_generic_call.zig +++ b/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'