Commit 60830e36e3
Changed files (10)
src
test
cases
compile_errors
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);
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 '_'
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 '_'
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 '_'
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 '_'
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 '_'
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 '_'
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 '_'
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 '_'
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 '_'