about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-03-11 12:14:00 +0000
committerbors <bors@rust-lang.org>2019-03-11 12:14:00 +0000
commitde5c3c4b07fb37028bb36b2271271caf24eec6f3 (patch)
tree4d07300a19b7c8f69d007264110c01a3bf8aa153
parentcf3c9a78aa6544631a09fb7f1705d51a5c91158a (diff)
parent9a6a269d56a7e1b63f744f602e96481b6559b89f (diff)
downloadrust-de5c3c4b07fb37028bb36b2271271caf24eec6f3.tar.gz
rust-de5c3c4b07fb37028bb36b2271271caf24eec6f3.zip
Auto merge of #59073 - Xanewok:rustup-rustc-interface, r=Zoxc
Update RLS and Clippy due to #56732 (rustc_interface crate)

Closes #59060.

In addition to plain submodule bumps, this also contains update to rls-rustc. The in-tree, from the RLS monorepo, version is used instead of the crates.io one (@nrc I think we might stop publishing `rls-rustc` altogether, right? It's only there to work around passing `-Zsave-analysis` to stable `rustc` and meant to be used only by RLS, IIRC).

@Zoxc also due to how we need to access the expanded AST still from the RLS side in order to pass save analysis data in-memory, I delayed the AST drop after the `after_analysis` callback if the `-Zsave-analysis` is passed.

It'd be also good if you could take a look at the changes inside the `rls` and `rls-rustc`: https://github.com/rust-lang/rls/compare/6a1b5a9cfda2ae19372e0613e76ebefba36edcf5...6840dd69af3ada1f8a432075f1f0be679ea8a468. The `rls-rustc` is based on your [PR](https://github.com/rust-dev-tools/rls-rustc/pull/11) but I also had to change some bits in the RLS itself.

r? @Zoxc / @Manishearth
-rw-r--r--Cargo.lock6
-rw-r--r--src/librustc_driver/lib.rs11
m---------src/tools/rls0
3 files changed, 10 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index bcb369d1554..db2a5f9ec7c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2257,7 +2257,7 @@ dependencies = [
  "rls-analysis 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)",
  "rls-blacklist 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-rustc 0.6.0",
  "rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2310,8 +2310,7 @@ dependencies = [
 
 [[package]]
 name = "rls-rustc"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+version = "0.6.0"
 
 [[package]]
 name = "rls-span"
@@ -4210,7 +4209,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum rls-analysis 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ae18d8ad01dec3b2014f4d7ae3c607d7adbcff79e5d3b48ea42ea71c10d43a71"
 "checksum rls-blacklist 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ce1fdac03e138c4617ff87b194e1ff57a39bb985a044ccbd8673d30701e411"
 "checksum rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f80b84551b32e26affaf7f12374913b5061730c0dcd185d9e8fa5a15e36e65c"
-"checksum rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9dba7390427aefa953608429701e3665192ca810ba8ae09301e001b7c7bed0"
 "checksum rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33d66f1d6c6ccd5c98029f162544131698f6ebb61d8c697681cac409dcd08805"
 "checksum rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72d56425bd5aa86d9d4372b76f0381d3b4bda9c0220e71956c9fcc929f45c1f1"
 "checksum rustc-ap-arena 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8be999235b541fc8eb54901b66e899a06076709ac5f53d6b2c5c59d29ad54780"
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 2b75a607f16..c7b6f37fe29 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -342,14 +342,12 @@ pub fn run_compiler(
         }
 
         if sess.opts.debugging_opts.save_analysis {
-            let expanded_crate = compiler.expansion()?.take().0;
-
+            let expanded_crate = &compiler.expansion()?.peek().0;
             let crate_name = compiler.crate_name()?.peek().clone();
             compiler.global_ctxt()?.peek_mut().enter(|tcx| {
                 let result = tcx.analysis(LOCAL_CRATE);
 
                 time(sess, "save analysis", || {
-                    // FIXME: Should this run even with analysis errors?
                     save::process_crate(
                         tcx,
                         &expanded_crate,
@@ -361,17 +359,24 @@ pub fn run_compiler(
                 });
 
                 result
+                // AST will be dropped *after* the `after_analysis` callback
+                // (needed by the RLS)
             })?;
         } else {
             // Drop AST after creating GlobalCtxt to free memory
             mem::drop(compiler.expansion()?.take());
         }
+
         compiler.global_ctxt()?.peek_mut().enter(|tcx| tcx.analysis(LOCAL_CRATE))?;
 
         if !callbacks.after_analysis(compiler) {
             return sess.compile_status();
         }
 
+        if sess.opts.debugging_opts.save_analysis {
+            mem::drop(compiler.expansion()?.take());
+        }
+
         compiler.ongoing_codegen()?;
 
         // Drop GlobalCtxt after starting codegen to free memory
diff --git a/src/tools/rls b/src/tools/rls
-Subproject 6a1b5a9cfda2ae19372e0613e76ebefba36edcf
+Subproject 6840dd69af3ada1f8a432075f1f0be679ea8a46