|
| 1 | +From a789b49e4c0e7d742cc39713484596293d844537 Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Fri, 30 Jul 2021 21:28:34 +0800 |
| 4 | +Subject: [PATCH] Use `Lrc` instead of `Rc` in `MiriCompilerCalls::config()` |
| 5 | + |
| 6 | +--- |
| 7 | + src/bin/miri.rs | 5 +++-- |
| 8 | + 1 file changed, 3 insertions(+), 2 deletions(-) |
| 9 | + |
| 10 | +diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs |
| 11 | +index 5a8f07263..18c393815 100644 |
| 12 | +--- a/src/tools/miri/src/bin/miri.rs |
| 13 | ++++ b/src/tools/miri/src/bin/miri.rs |
| 14 | +@@ -1,5 +1,6 @@ |
| 15 | + #![feature(rustc_private, bool_to_option, stmt_expr_attributes)] |
| 16 | + |
| 17 | ++extern crate rustc_data_structures; |
| 18 | + extern crate rustc_driver; |
| 19 | + extern crate rustc_errors; |
| 20 | + extern crate rustc_hir; |
| 21 | +@@ -12,12 +13,12 @@ use std::convert::TryFrom; |
| 22 | + use std::env; |
| 23 | + use std::num::NonZeroU64; |
| 24 | + use std::path::PathBuf; |
| 25 | +-use std::rc::Rc; |
| 26 | + use std::str::FromStr; |
| 27 | + |
| 28 | + use hex::FromHexError; |
| 29 | + use log::debug; |
| 30 | + |
| 31 | ++use rustc_data_structures::sync::Lrc; |
| 32 | + use rustc_driver::Compilation; |
| 33 | + use rustc_errors::emitter::{ColorConfig, HumanReadableErrorType}; |
| 34 | + use rustc_hir::{self as hir, def_id::LOCAL_CRATE, Node}; |
| 35 | +@@ -42,7 +43,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls { |
| 36 | + // HACK: rustc will emit "crate ... required to be available in rlib format, but |
| 37 | + // was not found in this form" errors once we use `tcx.dependency_formats()` if |
| 38 | + // there's no rlib provided, so setting a dummy path here to workaround those errors. |
| 39 | +- Rc::make_mut(&mut crate_source).rlib = Some((PathBuf::new(), PathKind::All)); |
| 40 | ++ Lrc::make_mut(&mut crate_source).rlib = Some((PathBuf::new(), PathKind::All)); |
| 41 | + crate_source |
| 42 | + }; |
| 43 | + }); |
0 commit comments