This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/tools/rust-analyzer/crates/project-model/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1094,8 +1094,7 @@ fn cargo_to_crate_graph(
10941094) -> ( CrateGraph , ProcMacroPaths ) {
10951095 let _p = tracing:: info_span!( "cargo_to_crate_graph" ) . entered ( ) ;
10961096 let mut res = ( CrateGraph :: default ( ) , ProcMacroPaths :: default ( ) ) ;
1097- let crate_graph = & mut res. 0 ;
1098- let proc_macros = & mut res. 1 ;
1097+ let ( crate_graph, proc_macros) = & mut res;
10991098 let ( public_deps, libproc_macro) =
11001099 sysroot_to_crate_graph ( crate_graph, sysroot, rustc_cfg. clone ( ) , load) ;
11011100
@@ -1560,6 +1559,10 @@ fn extend_crate_graph_with_sysroot(
15601559
15611560 // Remove all crates except the ones we are interested in to keep the sysroot graph small.
15621561 let removed_mapping = sysroot_crate_graph. remove_crates_except ( & marker_set) ;
1562+ sysroot_proc_macros = sysroot_proc_macros
1563+ . into_iter ( )
1564+ . filter_map ( |( k, v) | Some ( ( removed_mapping[ k. into_raw ( ) . into_u32 ( ) as usize ] ?, v) ) )
1565+ . collect ( ) ;
15631566 let mapping = crate_graph. extend ( sysroot_crate_graph, & mut sysroot_proc_macros) ;
15641567
15651568 // Map the id through the removal mapping first, then through the crate graph extension mapping.
You can’t perform that action at this time.
0 commit comments