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