Commit cd77365
committed
Fix closure coerced return type for add_return_type
Example
---
```rust
fn foo() {
let f = ||$0 {loop {}};
let _: fn() -> i8 = f;
}
```
**Before this PR**:
```rust
fn foo() {
let f = || -> ! {loop {}};
let _: fn() -> i8 = f;
}
```
mismatched types error on line 3
**After this PR**:
```rust
fn foo() {
let f = || -> i8 {loop {}};
let _: fn() -> i8 = f;
}
```1 parent c7921c6 commit cd77365
File tree
1 file changed
+16
-1
lines changed- src/tools/rust-analyzer/crates/ide-assists/src/handlers
1 file changed
+16
-1
lines changedLines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
424 | 439 | | |
425 | 440 | | |
426 | 441 | | |
| |||
0 commit comments