Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 8d7a716

Browse files
authored
Merge pull request #1677 from marmeladema/save-analysis-hir-tree
Do not pass `expanded_crate` as argument to `process_crate` anymore
2 parents 085f24b + 8e086c0 commit 8d7a716

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

rls-rustc/src/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,13 @@ impl Callbacks for ShimCalls {
169169
let input = compiler.input();
170170
let crate_name = queries.crate_name().unwrap().peek().clone();
171171

172-
// Guaranteed to not be dropped yet in the pipeline thanks to the
173-
// `config.opts.debugging_opts.save_analysis` value being set to `true`.
174-
let expanded_crate = &queries.expansion().unwrap().peek().0;
175172
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
176173
// There are two ways to move the data from rustc to the RLS, either
177174
// directly or by serialising and deserialising. We only want to do
178175
// the latter when there are compatibility issues between crates.
179176

180177
// This version passes via JSON, it is more easily backwards compatible.
181178
// save::process_crate(state.tcx.unwrap(),
182-
// state.expanded_crate.unwrap(),
183179
// state.analysis.unwrap(),
184180
// state.crate_name.unwrap(),
185181
// state.input,
@@ -189,7 +185,6 @@ impl Callbacks for ShimCalls {
189185
// This version passes directly, it is more efficient.
190186
rustc_save_analysis::process_crate(
191187
tcx,
192-
&expanded_crate,
193188
&crate_name,
194189
&input,
195190
None,

rls/src/build/rustc.rs

-5
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,13 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
276276
let input = compiler.input();
277277
let crate_name = queries.crate_name().unwrap().peek().clone();
278278

279-
// Guaranteed to not be dropped yet in the pipeline thanks to the
280-
// `config.opts.debugging_opts.save_analysis` value being set to `true`.
281-
let expanded_crate = &queries.expansion().unwrap().peek().0;
282279
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
283280
// There are two ways to move the data from rustc to the RLS, either
284281
// directly or by serialising and deserialising. We only want to do
285282
// the latter when there are compatibility issues between crates.
286283

287284
// This version passes via JSON, it is more easily backwards compatible.
288285
// save::process_crate(state.tcx.unwrap(),
289-
// state.expanded_crate.unwrap(),
290286
// state.analysis.unwrap(),
291287
// state.crate_name.unwrap(),
292288
// state.input,
@@ -296,7 +292,6 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
296292
// This version passes directly, it is more efficient.
297293
save::process_crate(
298294
tcx,
299-
&expanded_crate,
300295
&crate_name,
301296
&input,
302297
None,

0 commit comments

Comments
 (0)