File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
crates/ra_project_model/src Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -207,9 +207,25 @@ impl CargoWorkspace {
207
207
}
208
208
let resolve = meta. resolve . expect ( "metadata executed with deps" ) ;
209
209
for node in resolve. nodes {
210
- let source = pkg_by_id[ & node. id ] ;
210
+ let source = match pkg_by_id. get ( & node. id ) {
211
+ Some ( & src) => src,
212
+ None => {
213
+ log:: error!( "Node id do not match in cargo metadata, ignoring {}" , node. id) ;
214
+ continue ;
215
+ }
216
+ } ;
211
217
for dep_node in node. deps {
212
- let dep = PackageDependency { name : dep_node. name , pkg : pkg_by_id[ & dep_node. pkg ] } ;
218
+ let pkg = match pkg_by_id. get ( & dep_node. pkg ) {
219
+ Some ( & pkg) => pkg,
220
+ None => {
221
+ log:: error!(
222
+ "Dep node id do not match in cargo metadata, ignoring {}" ,
223
+ dep_node. pkg
224
+ ) ;
225
+ continue ;
226
+ }
227
+ } ;
228
+ let dep = PackageDependency { name : dep_node. name , pkg } ;
213
229
packages[ source] . dependencies . push ( dep) ;
214
230
}
215
231
packages[ source] . features . extend ( node. features ) ;
You can’t perform that action at this time.
0 commit comments