Commit b0f258b
committed
Tweak type mismatch caused by break on tail expr
When `break;` has a type mismatch because the `Destination` points at a tail
expression with an obligation flowing from a return type, point at the
return type.
Fix rust-lang#39968.1 parent d3d28a4 commit b0f258b
File tree
6 files changed
+44
-10
lines changed- src
- librustc_typeck/check
- librustc/traits
- test/ui/type
6 files changed
+44
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1169 | 1169 | | |
1170 | 1170 | | |
1171 | 1171 | | |
1172 | | - | |
| 1172 | + | |
1173 | 1173 | | |
1174 | 1174 | | |
1175 | 1175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
587 | 595 | | |
588 | 596 | | |
589 | 597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4246 | 4246 | | |
4247 | 4247 | | |
4248 | 4248 | | |
4249 | | - | |
| 4249 | + | |
4250 | 4250 | | |
4251 | 4251 | | |
4252 | 4252 | | |
| |||
4273 | 4273 | | |
4274 | 4274 | | |
4275 | 4275 | | |
4276 | | - | |
| 4276 | + | |
4277 | 4277 | | |
4278 | 4278 | | |
4279 | 4279 | | |
| |||
4386 | 4386 | | |
4387 | 4387 | | |
4388 | 4388 | | |
4389 | | - | |
| 4389 | + | |
4390 | 4390 | | |
4391 | 4391 | | |
4392 | 4392 | | |
| |||
4454 | 4454 | | |
4455 | 4455 | | |
4456 | 4456 | | |
4457 | | - | |
| 4457 | + | |
4458 | 4458 | | |
4459 | 4459 | | |
4460 | 4460 | | |
| |||
4498 | 4498 | | |
4499 | 4499 | | |
4500 | 4500 | | |
4501 | | - | |
| 4501 | + | |
4502 | 4502 | | |
4503 | 4503 | | |
4504 | 4504 | | |
| |||
4537 | 4537 | | |
4538 | 4538 | | |
4539 | 4539 | | |
4540 | | - | |
| 4540 | + | |
4541 | 4541 | | |
4542 | 4542 | | |
4543 | 4543 | | |
| |||
4603 | 4603 | | |
4604 | 4604 | | |
4605 | 4605 | | |
4606 | | - | |
| 4606 | + | |
4607 | 4607 | | |
4608 | 4608 | | |
4609 | 4609 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments