Skip to content

Commit de5c3c4

Browse files
committed
Auto merge of rust-lang#59073 - Xanewok:rustup-rustc-interface, r=Zoxc
Update RLS and Clippy due to rust-lang#56732 (rustc_interface crate) Closes rust-lang#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`: rust-lang/rls@6a1b5a9...6840dd6. The `rls-rustc` is based on your [PR](rust-dev-tools/rls-rustc#11) but I also had to change some bits in the RLS itself. r? @Zoxc / @Manishearth
2 parents cf3c9a7 + 9a6a269 commit de5c3c4

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Cargo.lock

+2-4
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@ dependencies = [
22572257
"rls-analysis 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)",
22582258
"rls-blacklist 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
22592259
"rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)",
2260-
"rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
2260+
"rls-rustc 0.6.0",
22612261
"rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
22622262
"rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
22632263
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2310,8 +2310,7 @@ dependencies = [
23102310

23112311
[[package]]
23122312
name = "rls-rustc"
2313-
version = "0.5.0"
2314-
source = "registry+https://github.com/rust-lang/crates.io-index"
2313+
version = "0.6.0"
23152314

23162315
[[package]]
23172316
name = "rls-span"
@@ -4210,7 +4209,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
42104209
"checksum rls-analysis 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ae18d8ad01dec3b2014f4d7ae3c607d7adbcff79e5d3b48ea42ea71c10d43a71"
42114210
"checksum rls-blacklist 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ce1fdac03e138c4617ff87b194e1ff57a39bb985a044ccbd8673d30701e411"
42124211
"checksum rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f80b84551b32e26affaf7f12374913b5061730c0dcd185d9e8fa5a15e36e65c"
4213-
"checksum rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9dba7390427aefa953608429701e3665192ca810ba8ae09301e001b7c7bed0"
42144212
"checksum rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33d66f1d6c6ccd5c98029f162544131698f6ebb61d8c697681cac409dcd08805"
42154213
"checksum rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72d56425bd5aa86d9d4372b76f0381d3b4bda9c0220e71956c9fcc929f45c1f1"
42164214
"checksum rustc-ap-arena 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8be999235b541fc8eb54901b66e899a06076709ac5f53d6b2c5c59d29ad54780"

src/librustc_driver/lib.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,12 @@ pub fn run_compiler(
342342
}
343343

344344
if sess.opts.debugging_opts.save_analysis {
345-
let expanded_crate = compiler.expansion()?.take().0;
346-
345+
let expanded_crate = &compiler.expansion()?.peek().0;
347346
let crate_name = compiler.crate_name()?.peek().clone();
348347
compiler.global_ctxt()?.peek_mut().enter(|tcx| {
349348
let result = tcx.analysis(LOCAL_CRATE);
350349

351350
time(sess, "save analysis", || {
352-
// FIXME: Should this run even with analysis errors?
353351
save::process_crate(
354352
tcx,
355353
&expanded_crate,
@@ -361,17 +359,24 @@ pub fn run_compiler(
361359
});
362360

363361
result
362+
// AST will be dropped *after* the `after_analysis` callback
363+
// (needed by the RLS)
364364
})?;
365365
} else {
366366
// Drop AST after creating GlobalCtxt to free memory
367367
mem::drop(compiler.expansion()?.take());
368368
}
369+
369370
compiler.global_ctxt()?.peek_mut().enter(|tcx| tcx.analysis(LOCAL_CRATE))?;
370371

371372
if !callbacks.after_analysis(compiler) {
372373
return sess.compile_status();
373374
}
374375

376+
if sess.opts.debugging_opts.save_analysis {
377+
mem::drop(compiler.expansion()?.take());
378+
}
379+
375380
compiler.ongoing_codegen()?;
376381

377382
// Drop GlobalCtxt after starting codegen to free memory

src/tools/rls

Submodule rls updated from 6a1b5a9 to 6840dd6

0 commit comments

Comments
 (0)