Commit 58d2c71
committed
Rust: load files from disk ourselves
This avoids problems with files containing invalid utf-8 data, which may cause
panic's like:
```
thread 'main' panicked at external/rules_rust~~_crate~ql~~r~r__ra_ap_salsa-0.0.232/src/input.rs:91:32:
no value set for CompressedFileTextQuery(FileId(2429))
stack backtrace:
0: rust_begin_unwind
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
1: core::panicking::panic_fmt
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::fetch
3: <DB as ra_ap_base_db::SourceDatabase>::compressed_file_text::__shim
4: <ra_ap_base_db::FileTextQuery as salsa::plumbing::QueryFunction>::execute
5: salsa::Cycle::catch
6: salsa::derived_lru::slot::Slot<Q,MP>::execute
7: salsa::derived_lru::slot::Slot<Q,MP>::read
8: <salsa::derived_lru::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
9: <DB as ra_ap_base_db::SourceDatabase>::file_text::__shim
10: <DB as ra_ap_base_db::SourceDatabase>::file_text
11: <ra_ap_base_db::ParseQuery as salsa::plumbing::QueryFunction>::execute
12: salsa::Cycle::catch
13: salsa::derived_lru::slot::Slot<Q,MP>::execute
14: salsa::derived_lru::slot::Slot<Q,MP>::read
15: <salsa::derived_lru::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
16: <DB as ra_ap_base_db::SourceDatabase>::parse::__shim
17: <DB as ra_ap_base_db::SourceDatabase>::parse
18: ra_ap_hir::semantics::SemanticsImpl::parse
19: single_arch_extractor::main
```1 parent f70f8a3 commit 58d2c71
2 files changed
+33
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
71 | 85 | | |
72 | 86 | | |
73 | 87 | | |
74 | | - | |
| 88 | + | |
| 89 | + | |
75 | 90 | | |
76 | 91 | | |
77 | 92 | | |
78 | 93 | | |
79 | 94 | | |
80 | 95 | | |
| 96 | + | |
81 | 97 | | |
82 | | - | |
83 | 98 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
87 | 102 | | |
88 | | - | |
89 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
90 | 110 | | |
91 | 111 | | |
92 | 112 | | |
| 113 | + | |
| 114 | + | |
93 | 115 | | |
94 | 116 | | |
95 | 117 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 118 | | |
109 | 119 | | |
110 | 120 | | |
| |||
0 commit comments