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

Commit

Permalink
Merge pull request #1678 from rust-lang/hir
Browse files Browse the repository at this point in the history
Merge branch used for save_analysis HIR rewrite
  • Loading branch information
Xanewok authored Jun 4, 2020
2 parents 085f24b + 8d7a716 commit 50d825e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
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

0 comments on commit 50d825e

Please sign in to comment.