From 2af7940474a9c6b3fc484a66028761ef60cb1553 Mon Sep 17 00:00:00 2001
From: Mark Rousskov <mark.simulacrum@gmail.com>
Date: Tue, 14 Jul 2020 08:56:12 -0400
Subject: [PATCH 1/3] 1.46 beta

---
 src/ci/run.sh  |  2 +-
 src/stage0.txt | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ci/run.sh b/src/ci/run.sh
index 59f2736cbd406..ff737ea869f2b 100755
--- a/src/ci/run.sh
+++ b/src/ci/run.sh
@@ -51,7 +51,7 @@ fi
 #
 # FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
 #        either automatically or manually.
-export RUST_RELEASE_CHANNEL=nightly
+export RUST_RELEASE_CHANNEL=beta
 
 # Always set the release channel for bootstrap; this is normally not important (i.e., only dist
 # builds would seem to matter) but in practice bootstrap wants to know whether we're targeting
diff --git a/src/stage0.txt b/src/stage0.txt
index 769ec669bdc8d..2c87531eb96b3 100644
--- a/src/stage0.txt
+++ b/src/stage0.txt
@@ -12,15 +12,15 @@
 # source tarball for a stable release you'll likely see `1.x.0` for rustc and
 # `0.(x+1).0` for Cargo where they were released on `date`.
 
-date: 2020-06-16
-rustc: beta
-cargo: beta
+date: 2020-07-13
+rustc: 1.45.0
+cargo: 0.46.0
 
 # We use a nightly rustfmt to format the source because it solves some
 # bootstrapping issues with use of new syntax in this repo. If you're looking at
 # the beta/stable branch, this key should be omitted, as we don't want to depend
 # on rustfmt from nightly there.
-rustfmt: nightly-2020-04-22
+#rustfmt: nightly-2020-04-22
 
 # When making a stable release the process currently looks like:
 #
@@ -40,4 +40,4 @@ rustfmt: nightly-2020-04-22
 # looking at a beta source tarball and it's uncommented we'll shortly comment it
 # out.
 
-#dev: 1
+dev: 1

From 83b6d84a2f8ec7d85f7484e93f80130672965b83 Mon Sep 17 00:00:00 2001
From: Mark Rousskov <mark.simulacrum@gmail.com>
Date: Tue, 14 Jul 2020 21:09:06 -0400
Subject: [PATCH 2/3] Dummy function to re-add const_transmute feature gate

---
 src/libcore/intrinsics.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 540a8cfb290b3..208fa2a4a8eff 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -1287,7 +1287,7 @@ extern "rust-intrinsic" {
     #[stable(feature = "rust1", since = "1.0.0")]
     // NOTE: While this makes the intrinsic const stable, we have some custom code in const fn
     // checks that prevent its use within `const fn`.
-    #[rustc_const_stable(feature = "const_transmute", since = "1.46.0")]
+    #[rustc_const_stable(feature = "const_transmute_in_consts", since = "1.46.0")]
     pub fn transmute<T, U>(e: T) -> U;
 
     /// Returns `true` if the actual type given as `T` requires drop
@@ -2286,3 +2286,7 @@ pub unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
     // SAFETY: the safety contract for `write_bytes` must be upheld by the caller.
     unsafe { write_bytes(dst, val, count) }
 }
+
+// dummy function to unbreak beta builds
+#[rustc_const_unstable(feature = "const_transmute", issue = "53605")]
+const fn _bar() {}

From dba515e8610d7dbe2d3bb175aaddaa124e2dc9dd Mon Sep 17 00:00:00 2001
From: Mark Rousskov <mark.simulacrum@gmail.com>
Date: Wed, 15 Jul 2020 08:11:21 -0400
Subject: [PATCH 3/3] Cherry-pick non-nightly rustfmt fixes

---
 src/tools/rustfmt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tools/rustfmt b/src/tools/rustfmt
index c1e9b7b87493c..8157a3f0afe97 160000
--- a/src/tools/rustfmt
+++ b/src/tools/rustfmt
@@ -1 +1 @@
-Subproject commit c1e9b7b87493c5197c4330693bdf4ccb30a90971
+Subproject commit 8157a3f0afe978d3e953420577f8344db7e905bf