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

Do not pass expanded_crate as argument to process_crate anymore #1677

Merged
merged 1 commit into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions rls-rustc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,13 @@ impl Callbacks for ShimCalls {
let input = compiler.input();
let crate_name = queries.crate_name().unwrap().peek().clone();

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

// This version passes via JSON, it is more easily backwards compatible.
// save::process_crate(state.tcx.unwrap(),
// state.expanded_crate.unwrap(),
// state.analysis.unwrap(),
// state.crate_name.unwrap(),
// state.input,
Expand All @@ -189,7 +185,6 @@ impl Callbacks for ShimCalls {
// This version passes directly, it is more efficient.
rustc_save_analysis::process_crate(
tcx,
&expanded_crate,
&crate_name,
&input,
None,
Expand Down
5 changes: 0 additions & 5 deletions rls/src/build/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,13 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
let input = compiler.input();
let crate_name = queries.crate_name().unwrap().peek().clone();

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

// This version passes via JSON, it is more easily backwards compatible.
// save::process_crate(state.tcx.unwrap(),
// state.expanded_crate.unwrap(),
// state.analysis.unwrap(),
// state.crate_name.unwrap(),
// state.input,
Expand All @@ -296,7 +292,6 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
// This version passes directly, it is more efficient.
save::process_crate(
tcx,
&expanded_crate,
&crate_name,
&input,
None,
Expand Down