Skip to content

Commit 1f969da

Browse files
committed
Auto merge of #1863 - hyd-dev:parallel-compiler, r=RalfJung
Use `Lrc` instead of `Rc` in `MiriCompilerCalls::config()` The `used_crate_source` query defines its return type as [`Lrc<CrateSource>`](https://github.com/rust-lang/rust/blob/1195bea5a7b73e079fa14b37ac7e375fc77d368a/compiler/rustc_middle/src/query/mod.rs#L1418), which would be `Arc` when `parallel-compiler = true`. I assume this fixes rust-lang/rust#87623. I didn't test that locally -- I'm not interested in `parallel-compiler = true` enough to be willing to recompile rustc with that configuration to test it, but I'm submitting this in case it might be useful for `parallel-compiler = true` users.
2 parents 453e3ef + a789b49 commit 1f969da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/miri.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(rustc_private, bool_to_option, stmt_expr_attributes)]
22

3+
extern crate rustc_data_structures;
34
extern crate rustc_driver;
45
extern crate rustc_errors;
56
extern crate rustc_hir;
@@ -12,12 +13,12 @@ use std::convert::TryFrom;
1213
use std::env;
1314
use std::num::NonZeroU64;
1415
use std::path::PathBuf;
15-
use std::rc::Rc;
1616
use std::str::FromStr;
1717

1818
use hex::FromHexError;
1919
use log::debug;
2020

21+
use rustc_data_structures::sync::Lrc;
2122
use rustc_driver::Compilation;
2223
use rustc_errors::emitter::{ColorConfig, HumanReadableErrorType};
2324
use rustc_hir::{self as hir, def_id::LOCAL_CRATE, Node};
@@ -42,7 +43,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
4243
// HACK: rustc will emit "crate ... required to be available in rlib format, but
4344
// was not found in this form" errors once we use `tcx.dependency_formats()` if
4445
// there's no rlib provided, so setting a dummy path here to workaround those errors.
45-
Rc::make_mut(&mut crate_source).rlib = Some((PathBuf::new(), PathKind::All));
46+
Lrc::make_mut(&mut crate_source).rlib = Some((PathBuf::new(), PathKind::All));
4647
crate_source
4748
};
4849
});

0 commit comments

Comments
 (0)