Skip to content

Commit f28a9f2

Browse files
committed
Update to Rust 1.43.0.
We unfortunately have to add a patch to fix rust-lang/rust#69352.
1 parent e6fe931 commit f28a9f2

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From 00ab608642b2b7f8a1dfa4b04958c5188c71cff8 Mon Sep 17 00:00:00 2001
2+
From: Joel Galenson <[email protected]>
3+
Date: Thu, 23 Apr 2020 12:43:32 -0700
4+
Subject: [PATCH] Revert "Change opt-level from 2 back to 3"
5+
6+
This reverts commit 0d52c562db18e85cf53078c9ddb40abe469a4aab.
7+
---
8+
Cargo.toml | 7 +++++++
9+
src/librustc_mir/interpret/step.rs | 3 ---
10+
src/test/run-make/wasm-stringify-ints-small/Makefile | 2 +-
11+
3 files changed, 8 insertions(+), 4 deletions(-)
12+
13+
diff --git a/Cargo.toml b/Cargo.toml
14+
index 2f5a708e8dc..9d5c27b96df 100644
15+
--- a/Cargo.toml
16+
+++ b/Cargo.toml
17+
@@ -31,6 +31,13 @@ exclude = [
18+
"obj",
19+
]
20+
21+
+# Curiously, LLVM 7.0 will segfault if compiled with opt-level=3
22+
+# See issue https://github.com/rust-lang/rust/issues/52378
23+
+[profile.release]
24+
+opt-level = 2
25+
+[profile.bench]
26+
+opt-level = 2
27+
+
28+
# These options are controlled from our rustc wrapper script, so turn them off
29+
# here and have them controlled elsewhere.
30+
[profile.dev]
31+
diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs
32+
index f298a6677d6..4a3f4d9b14e 100644
33+
--- a/src/librustc_mir/interpret/step.rs
34+
+++ b/src/librustc_mir/interpret/step.rs
35+
@@ -38,9 +38,6 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
36+
/// Returns `true` as long as there are more things to do.
37+
///
38+
/// This is used by [priroda](https://github.com/oli-obk/priroda)
39+
- ///
40+
- /// This is marked `#inline(always)` to work around adverserial codegen when `opt-level = 3`
41+
- #[inline(always)]
42+
pub fn step(&mut self) -> InterpResult<'tcx, bool> {
43+
if self.stack.is_empty() {
44+
return Ok(false);
45+
diff --git a/src/test/run-make/wasm-stringify-ints-small/Makefile b/src/test/run-make/wasm-stringify-ints-small/Makefile
46+
index 01e1c6b0ce8..26de6a0c689 100644
47+
--- a/src/test/run-make/wasm-stringify-ints-small/Makefile
48+
+++ b/src/test/run-make/wasm-stringify-ints-small/Makefile
49+
@@ -4,7 +4,7 @@ ifeq ($(TARGET),wasm32-unknown-unknown)
50+
all:
51+
$(RUSTC) foo.rs -C lto -O --target wasm32-unknown-unknown
52+
wc -c < $(TMPDIR)/foo.wasm
53+
- [ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "25000" ]
54+
+ [ "`wc -c < $(TMPDIR)/foo.wasm`" -lt "20500" ]
55+
else
56+
all:
57+
endif
58+
--
59+
2.26.2.303.gf8c07b1a785-goog
60+

repro.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ compile() {
1111

1212
# Dowload and setup Cargo with our patches.
1313
if [ ! -d cargo ]; then
14-
git clone --branch rust-1.42.0 https://github.com/rust-lang/cargo.git
14+
git clone --branch rust-1.43.0 https://github.com/rust-lang/cargo.git
1515
# Apply the patch.
1616
git -C cargo apply ${PWD}/patches/cargo*
1717
fi
1818

1919
# Download and set up the two rustc directories with our patches.
2020
if [ ! -d rust-a ]; then
21-
git clone --branch 1.42.0 https://github.com/rust-lang/rust.git rust-a
21+
git clone --branch 1.43.0 https://github.com/rust-lang/rust.git rust-a
2222
# Run x.py and do nothing so it downloads LLVM and other tools.
2323
cd rust-a
2424
./x.py

0 commit comments

Comments
 (0)