Skip to content

Commit 8462be6

Browse files
committed
dev-lang/rust: port fix for compile fault with +parallel +miri
rust-lang/rust#87623 Signed-off-by: Miezhiko <[email protected]>
1 parent 9bc7de0 commit 8462be6

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From a789b49e4c0e7d742cc39713484596293d844537 Mon Sep 17 00:00:00 2001
2+
From: hyd-dev <[email protected]>
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+
});

dev-lang/rust/rust-1.54.0.ebuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ PATCHES=(
149149
"${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch
150150
"${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch
151151
"${FILESDIR}"/1.53.0-rustversion-1.0.5.patch # https://github.com/rust-lang/rust/pull/86425
152+
"${FILESDIR}"/1.54.0-parallel-miri.patch # https://github.com/rust-lang/miri/pull/1863
152153
)
153154

154155
S="${WORKDIR}/${MY_P}-src"

0 commit comments

Comments
 (0)