| ... | ... | @@ -28657,7 +28657,7 @@ fn coerceExtra( |
| 28657 | 28657 | if (!dest_info.flags.is_const) { |
| 28658 | 28658 | const err_msg = err_msg: { |
| 28659 | 28659 | const err_msg = try sema.errMsg(block, inst_src, "cannot cast pointer to tuple to '{}'", .{dest_ty.fmt(mod)}); |
| 28660 | | errdefer err_msg.deinit(sema.gpa); |
| 28660 | errdefer err_msg.destroy(sema.gpa); |
| 28661 | 28661 | try sema.errNote(block, dest_ty_src, err_msg, "pointers to tuples can only coerce to constant pointers", .{}); |
| 28662 | 28662 | break :err_msg err_msg; |
| 28663 | 28663 | }; |
| ... | ... | @@ -32599,31 +32599,39 @@ fn analyzeSlice( |
| 32599 | 32599 | |
| 32600 | 32600 | if (try sema.compareScalar(start_value, .neq, end_value, Type.comptime_int)) { |
| 32601 | 32601 | if (try sema.compareScalar(start_value, .neq, Value.zero_comptime_int, Type.comptime_int)) { |
| 32602 | | const err_msg = try sema.errMsg(block, start_src, bounds_error_message, .{}); |
| 32603 | | try sema.errNote( |
| 32604 | | block, |
| 32605 | | start_src, |
| 32606 | | err_msg, |
| 32607 | | "expected '{}', found '{}'", |
| 32608 | | .{ |
| 32609 | | Value.zero_comptime_int.fmtValue(Type.comptime_int, mod), |
| 32610 | | start_value.fmtValue(Type.comptime_int, mod), |
| 32611 | | }, |
| 32612 | | ); |
| 32613 | | return sema.failWithOwnedErrorMsg(block, err_msg); |
| 32602 | const msg = msg: { |
| 32603 | const msg = try sema.errMsg(block, start_src, bounds_error_message, .{}); |
| 32604 | errdefer msg.destroy(sema.gpa); |
| 32605 | try sema.errNote( |
| 32606 | block, |
| 32607 | start_src, |
| 32608 | msg, |
| 32609 | "expected '{}', found '{}'", |
| 32610 | .{ |
| 32611 | Value.zero_comptime_int.fmtValue(Type.comptime_int, mod), |
| 32612 | start_value.fmtValue(Type.comptime_int, mod), |
| 32613 | }, |
| 32614 | ); |
| 32615 | break :msg msg; |
| 32616 | }; |
| 32617 | return sema.failWithOwnedErrorMsg(block, msg); |
| 32614 | 32618 | } else if (try sema.compareScalar(end_value, .neq, Value.one_comptime_int, Type.comptime_int)) { |
| 32615 | | const err_msg = try sema.errMsg(block, end_src, bounds_error_message, .{}); |
| 32616 | | try sema.errNote( |
| 32617 | | block, |
| 32618 | | end_src, |
| 32619 | | err_msg, |
| 32620 | | "expected '{}', found '{}'", |
| 32621 | | .{ |
| 32622 | | Value.one_comptime_int.fmtValue(Type.comptime_int, mod), |
| 32623 | | end_value.fmtValue(Type.comptime_int, mod), |
| 32624 | | }, |
| 32625 | | ); |
| 32626 | | return sema.failWithOwnedErrorMsg(block, err_msg); |
| 32619 | const msg = msg: { |
| 32620 | const msg = try sema.errMsg(block, end_src, bounds_error_message, .{}); |
| 32621 | errdefer msg.destroy(sema.gpa); |
| 32622 | try sema.errNote( |
| 32623 | block, |
| 32624 | end_src, |
| 32625 | msg, |
| 32626 | "expected '{}', found '{}'", |
| 32627 | .{ |
| 32628 | Value.one_comptime_int.fmtValue(Type.comptime_int, mod), |
| 32629 | end_value.fmtValue(Type.comptime_int, mod), |
| 32630 | }, |
| 32631 | ); |
| 32632 | break :msg msg; |
| 32633 | }; |
| 32634 | return sema.failWithOwnedErrorMsg(block, msg); |
| 32627 | 32635 | } |
| 32628 | 32636 | } else { |
| 32629 | 32637 | if (try sema.compareScalar(end_value, .gt, Value.one_comptime_int, Type.comptime_int)) { |