Skip to content

Commit

Permalink
Update Sema.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbangsheshotmedown authored Oct 31, 2024
1 parent f95826d commit 9858dcf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions zig/src/Sema.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3456,13 +3456,13 @@ fn ensureResultUsed(
.void, .noreturn => return,
.error_set => return sema.fail(block, src, "error set is ignored", .{}),
.error_union => {
const msg = msg: {
const msg = try sema.errMsg(src, "error union is ignored", .{});
errdefer msg.destroy(sema.gpa);
try sema.errNote(src, msg, "consider using 'try', 'catch', or 'if'", .{});
break :msg msg;
};
return sema.failWithOwnedErrorMsg(block, msg);
// const msg = msg: {
// const msg = try sema.errMsg(src, "error union is ignored", .{});
// errdefer msg.destroy(sema.gpa);
// try sema.errNote(src, msg, "consider using 'try', 'catch', or 'if'", .{});
// break :msg msg;
// };
// return sema.failWithOwnedErrorMsg(block, msg);
},
else => {
const msg = msg: {
Expand Down

0 comments on commit 9858dcf

Please sign in to comment.