Commit 6be021b
committed
Rollup merge of rust-lang#48778 - sinkuu:rls_crash_tuple_struct, r=nrc
Fix save-analysis generation crash with invalid tuple access
Reproduction:
```rust
fn invalid_tuple_struct_accessing() {
bar.0;
}
```
```
error[E0425]: cannot find value `bar` in this scope
--> test.rs:2:5
|
2 | bar.0;
| ^^^ not found in this scope
error[E0601]: main function not found
error: internal compiler error: librustc_save_analysis/dump_visitor.rs:1678: Expected struct or tuple type, found TyError
--> test.rs:2:5
|
2 | bar.0;
| ^^^^^
thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:482:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
This should fix a crash in RLS when editing such code. cc @nrcFile tree
2 files changed
+21
-8
lines changed- src
- librustc_save_analysis
- test/run-make/save-analysis-fail
2 files changed
+21
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
1675 | 1678 | | |
1676 | 1679 | | |
1677 | 1680 | | |
1678 | | - | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
1679 | 1685 | | |
1680 | 1686 | | |
1681 | 1687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
0 commit comments