| ... | @@ -145,8 +145,10 @@ pub fn blockExpr(mod: *Module, parent_scope: *Scope, block_node: *ast.Node.Block | ... | @@ -145,8 +145,10 @@ pub fn blockExpr(mod: *Module, parent_scope: *Scope, block_node: *ast.Node.Block |
| 145 | | 145 | |
| 146 | else => { | 146 | else => { |
| 147 | const possibly_unused_result = try expr(mod, scope, .none, statement); | 147 | const possibly_unused_result = try expr(mod, scope, .none, statement); |
| 148 | const src = scope.tree().token_locs[statement.firstToken()].start; | 148 | if (!possibly_unused_result.tag.isNoReturn()) { |
| 149 | _ = try addZIRUnOp(mod, scope, src, .ensure_result_used, possibly_unused_result); | 149 | const src = scope.tree().token_locs[statement.firstToken()].start; |
| | 150 | _ = try addZIRUnOp(mod, scope, src, .ensure_result_used, possibly_unused_result); |
| | 151 | } |
| 150 | }, | 152 | }, |
| 151 | } | 153 | } |
| 152 | } | 154 | } |