dev-lang/rust: port fix for compile fault with +parallel +miri

https://github.com/rust-lang/rust/issues/87623

Closes: https://github.com/gentoo/gentoo/pull/21923
Signed-off-by: Miezhiko <Miezhiko@gmail.com>
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
This commit is contained in:
Miezhiko
2021-08-09 10:21:20 +04:00
committed by Georgy Yakovlev
parent ae62d374d4
commit f4f70ee150
2 changed files with 44 additions and 0 deletions

View File

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

View File

@@ -149,6 +149,7 @@ PATCHES=(
"${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch
"${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch
"${FILESDIR}"/1.53.0-rustversion-1.0.5.patch # https://github.com/rust-lang/rust/pull/86425
"${FILESDIR}"/1.54.0-parallel-miri.patch # https://github.com/rust-lang/miri/pull/1863
)
S="${WORKDIR}/${MY_P}-src"