diff --git a/src/Sema.zig b/src/Sema.zig index 37fdf0adb5..3ff817cbd1 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -3571,7 +3571,7 @@ fn ensureResultUsed( const msg = try sema.errMsg(block, src, "value of type '{}' ignored", .{ty.fmt(sema.mod)}); errdefer msg.destroy(sema.gpa); try sema.errNote(block, src, msg, "all non-void values must be used", .{}); - try sema.errNote(block, src, msg, "this error can be suppressed by assigning the value to '_'", .{}); + try sema.errNote(block, src, msg, "to discard the value, assign it to '_'", .{}); break :msg msg; }; return sema.failWithOwnedErrorMsg(block, msg); diff --git a/test/cases/compile_errors/for_loop_body_expression_ignored.zig b/test/cases/compile_errors/for_loop_body_expression_ignored.zig index a0247139ea..9c5e381e63 100644 --- a/test/cases/compile_errors/for_loop_body_expression_ignored.zig +++ b/test/cases/compile_errors/for_loop_body_expression_ignored.zig @@ -23,13 +23,13 @@ export fn f4() void { // // :5:30: error: value of type 'usize' ignored // :5:30: note: all non-void values must be used -// :5:30: note: this error can be suppressed by assigning the value to '_' +// :5:30: note: to discard the value, assign it to '_' // :9:30: error: value of type 'usize' ignored // :9:30: note: all non-void values must be used -// :9:30: note: this error can be suppressed by assigning the value to '_' +// :9:30: note: to discard the value, assign it to '_' // :13:31: error: value of type 'bool' ignored // :13:31: note: all non-void values must be used -// :13:31: note: this error can be suppressed by assigning the value to '_' +// :13:31: note: to discard the value, assign it to '_' // :16:42: error: value of type 'usize' ignored // :16:42: note: all non-void values must be used -// :16:42: note: this error can be suppressed by assigning the value to '_' +// :16:42: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/generic_instantiation_failure.zig b/test/cases/compile_errors/generic_instantiation_failure.zig index 42e4c4e8c8..d820f8f410 100644 --- a/test/cases/compile_errors/generic_instantiation_failure.zig +++ b/test/cases/compile_errors/generic_instantiation_failure.zig @@ -24,4 +24,4 @@ pub export fn entry() void { // // :18:43: error: value of type 'type' ignored // :18:43: note: all non-void values must be used -// :18:43: note: this error can be suppressed by assigning the value to '_' +// :18:43: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/ignored_assert-err-ok_return_value.zig b/test/cases/compile_errors/ignored_assert-err-ok_return_value.zig index 1257636622..abe2b006b7 100644 --- a/test/cases/compile_errors/ignored_assert-err-ok_return_value.zig +++ b/test/cases/compile_errors/ignored_assert-err-ok_return_value.zig @@ -11,4 +11,4 @@ fn bar() anyerror!i32 { // // :2:11: error: value of type 'i32' ignored // :2:11: note: all non-void values must be used -// :2:11: note: this error can be suppressed by assigning the value to '_' +// :2:11: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/ignored_comptime_statement_value.zig b/test/cases/compile_errors/ignored_comptime_statement_value.zig index 2067f3b716..4dd0e0fc39 100644 --- a/test/cases/compile_errors/ignored_comptime_statement_value.zig +++ b/test/cases/compile_errors/ignored_comptime_statement_value.zig @@ -10,4 +10,4 @@ export fn foo() void { // // :3:9: error: value of type 'comptime_int' ignored // :3:9: note: all non-void values must be used -// :3:9: note: this error can be suppressed by assigning the value to '_' +// :3:9: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/ignored_comptime_value.zig b/test/cases/compile_errors/ignored_comptime_value.zig index 3414d0861f..ed7eb80b50 100644 --- a/test/cases/compile_errors/ignored_comptime_value.zig +++ b/test/cases/compile_errors/ignored_comptime_value.zig @@ -14,7 +14,7 @@ fn bar() u8 { // // :2:5: error: value of type 'comptime_int' ignored // :2:5: note: all non-void values must be used -// :2:5: note: this error can be suppressed by assigning the value to '_' +// :2:5: note: to discard the value, assign it to '_' // :5:5: error: value of type 'u8' ignored // :5:5: note: all non-void values must be used -// :5:5: note: this error can be suppressed by assigning the value to '_' +// :5:5: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/ignored_deferred_statement_value.zig b/test/cases/compile_errors/ignored_deferred_statement_value.zig index 1f42efc3f5..70b88a4deb 100644 --- a/test/cases/compile_errors/ignored_deferred_statement_value.zig +++ b/test/cases/compile_errors/ignored_deferred_statement_value.zig @@ -10,4 +10,4 @@ export fn foo() void { // // :3:9: error: value of type 'comptime_int' ignored // :3:9: note: all non-void values must be used -// :3:9: note: this error can be suppressed by assigning the value to '_' +// :3:9: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/ignored_return_value.zig b/test/cases/compile_errors/ignored_return_value.zig index 08424c4fe9..f721bc8655 100644 --- a/test/cases/compile_errors/ignored_return_value.zig +++ b/test/cases/compile_errors/ignored_return_value.zig @@ -11,4 +11,4 @@ fn bar() i32 { // // :2:8: error: value of type 'i32' ignored // :2:8: note: all non-void values must be used -// :2:8: note: this error can be suppressed by assigning the value to '_' +// :2:8: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/ignored_statement_value.zig b/test/cases/compile_errors/ignored_statement_value.zig index c73da84420..6c4ff442c5 100644 --- a/test/cases/compile_errors/ignored_statement_value.zig +++ b/test/cases/compile_errors/ignored_statement_value.zig @@ -8,4 +8,4 @@ export fn foo() void { // // :2:5: error: value of type 'comptime_int' ignored // :2:5: note: all non-void values must be used -// :2:5: note: this error can be suppressed by assigning the value to '_' +// :2:5: note: to discard the value, assign it to '_' diff --git a/test/cases/compile_errors/while_loop_body_expression_ignored.zig b/test/cases/compile_errors/while_loop_body_expression_ignored.zig index b3e83f202a..dae546df02 100644 --- a/test/cases/compile_errors/while_loop_body_expression_ignored.zig +++ b/test/cases/compile_errors/while_loop_body_expression_ignored.zig @@ -32,16 +32,16 @@ export fn f5() void { // // :5:25: error: value of type 'usize' ignored // :5:25: note: all non-void values must be used -// :5:25: note: this error can be suppressed by assigning the value to '_' +// :5:25: note: to discard the value, assign it to '_' // :10:26: error: value of type 'usize' ignored // :10:26: note: all non-void values must be used -// :10:26: note: this error can be suppressed by assigning the value to '_' +// :10:26: note: to discard the value, assign it to '_' // :15:26: error: value of type 'usize' ignored // :15:26: note: all non-void values must be used -// :15:26: note: this error can be suppressed by assigning the value to '_' +// :15:26: note: to discard the value, assign it to '_' // :20:23: error: value of type 'bool' ignored // :20:23: note: all non-void values must be used -// :20:23: note: this error can be suppressed by assigning the value to '_' +// :20:23: note: to discard the value, assign it to '_' // :25:34: error: value of type 'usize' ignored // :25:34: note: all non-void values must be used -// :25:34: note: this error can be suppressed by assigning the value to '_' +// :25:34: note: to discard the value, assign it to '_'