Fix bootstrap for stage0 rust 1.51

This commit is contained in:
Josh Stone 2021-04-14 18:43:41 -07:00
parent 546915fc9c
commit 5789d99323
2 changed files with 54 additions and 0 deletions

View File

@ -83,6 +83,10 @@ Patch3: rustc-1.51.0-backport-pr82289.patch
# https://github.com/rust-lang/rust/pull/82292
Patch4: rustc-1.51.0-backport-pr82292.patch
# Fix bootstrap for stage0 rust 1.51
# https://github.com/rust-lang/rust/pull/81910
Patch5: rustc-1.51.0-backport-pr81910.patch
### RHEL-specific patches below ###
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
@ -420,6 +424,7 @@ test -f '%{local_rust_root}/bin/rustc'
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%if %with disabled_libssh2
%patch100 -p1
@ -752,6 +757,7 @@ export %{rust_env}
%changelog
* Wed Apr 14 2021 Josh Stone <jistone@redhat.com> - 1.51.0-2
- Security fixes for CVE-2021-28876, CVE-2021-28878, CVE-2021-28879
- Fix bootstrap for stage0 rust 1.51
* Thu Mar 25 2021 Josh Stone <jistone@redhat.com> - 1.51.0-1
- Update to 1.51.0.

View File

@ -0,0 +1,48 @@
From 852684d306cee955ed751f1e8d8eec6adaecff3b 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);
| ^^^^^^^^^^^^^^^^^^^^^^
```
(cherry picked from commit 31c93397bde772764cda3058e16f9cef61895090)
---
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 f1a160250dbe..0f5fcb4af400 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1490,7 +1490,7 @@ pub fn ensure<S: Step>(&'a self, step: S) -> S::Output {
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));
--
2.31.1