summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2021-05-10 15:59:18 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-05-10 16:01:49 -0700
commit43cb7dae4ba43553cc87a55d217aea27a458b8c4 (patch)
tree4636d9d9b20475b804c063df18f0d2bdcca2f918 /sys-devel/rust-std
parentsys-devel/rust-std: bump to 1.52.1 (diff)
downloadgentoo-43cb7dae4ba43553cc87a55d217aea27a458b8c4.tar.gz
gentoo-43cb7dae4ba43553cc87a55d217aea27a458b8c4.tar.bz2
gentoo-43cb7dae4ba43553cc87a55d217aea27a458b8c4.zip
sys-devel/rust-std: add bootstrap patch
Closes: https://bugs.gentoo.org/788853 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'sys-devel/rust-std')
-rw-r--r--sys-devel/rust-std/files/1.51.0-bootstrap-panic.patch43
-rw-r--r--sys-devel/rust-std/rust-std-1.51.0.ebuild2
2 files changed, 45 insertions, 0 deletions
diff --git a/sys-devel/rust-std/files/1.51.0-bootstrap-panic.patch b/sys-devel/rust-std/files/1.51.0-bootstrap-panic.patch
new file mode 100644
index 000000000000..529d5a1f402f
--- /dev/null
+++ b/sys-devel/rust-std/files/1.51.0-bootstrap-panic.patch
@@ -0,0 +1,43 @@
+From 31c93397bde772764cda3058e16f9cef61895090 Mon Sep 17 00:00:00 2001
+From: Joshua Nelson <jyn514@gmail.com>
+Date: Mon, 8 Feb 2021 22:51:21 -0500
+Subject: [PATCH] Use format string in bootstrap panic instead of a string
+ directly
+
+This fixes the following warning when compiling with nightly:
+
+```
+warning: panic message is not a string literal
+ --> src/bootstrap/builder.rs:1515:24
+ |
+1515 | panic!(out);
+ | ^^^
+ |
+ = note: `#[warn(non_fmt_panic)]` on by default
+ = note: this is no longer accepted in Rust 2021
+help: add a "{}" format string to Display the message
+ |
+1515 | panic!("{}", out);
+ | ^^^^^
+help: or use std::panic::panic_any instead
+ |
+1515 | std::panic::panic_any(out);
+ | ^^^^^^^^^^^^^^^^^^^^^^
+```
+---
+ src/bootstrap/builder.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index f1a160250dbe1..0f5fcb4af400d 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
+ for el in stack.iter().rev() {
+ out += &format!("\t{:?}\n", el);
+ }
+- panic!(out);
++ panic!("{}", out);
+ }
+ if let Some(out) = self.cache.get(&step) {
+ self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
diff --git a/sys-devel/rust-std/rust-std-1.51.0.ebuild b/sys-devel/rust-std/rust-std-1.51.0.ebuild
index 7ca481644a6a..935388d41a01 100644
--- a/sys-devel/rust-std/rust-std-1.51.0.ebuild
+++ b/sys-devel/rust-std/rust-std-1.51.0.ebuild
@@ -38,6 +38,8 @@ QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
S="${WORKDIR}/${P/-std/c}-src"
+PATCHES=( "${FILESDIR}"/1.51.0-bootstrap-panic.patch )
+
#
# The cross magic
#