From bdacdf49e532ce869d1eb96e967fd77991566a7f Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 16:34:03 +0100
Subject: [PATCH 01/21] Remove unused core_intrinsics feature gate from
 bootstrap

---
 src/bootstrap/lib.rs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 637323331f582..042e3b55cc994 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -103,7 +103,6 @@
 //! More documentation can be found in each respective module below, and you can
 //! also check out the `src/bootstrap/README.md` file for more information.
 
-#![feature(core_intrinsics)]
 #![feature(drain_filter)]
 
 use std::cell::{Cell, RefCell};

From 095963f91d525951cb0183648c47c427fb69f16d Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 18:49:26 +0100
Subject: [PATCH 02/21] Remove unused feature gates from librustc

---
 src/librustc/lib.rs | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index 744ee1a65e154..33552ffb03e6d 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -27,7 +27,6 @@
 //! This API is completely unstable and subject to change.
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
-#![feature(arbitrary_self_types)]
 #![feature(bool_to_option)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
@@ -39,21 +38,15 @@
 #![feature(overlapping_marker_traits)]
 #![feature(extern_types)]
 #![feature(nll)]
-#![feature(optin_builtin_traits)]
 #![feature(option_expect_none)]
 #![feature(range_is_empty)]
 #![feature(specialization)]
-#![feature(unboxed_closures)]
-#![feature(thread_local)]
-#![feature(trace_macros)]
 #![feature(trusted_len)]
 #![feature(vec_remove_item)]
 #![feature(stmt_expr_attributes)]
-#![feature(integer_atomics)]
 #![feature(test)]
 #![feature(in_band_lifetimes)]
 #![feature(crate_visibility_modifier)]
-#![feature(log_syntax)]
 #![feature(associated_type_bounds)]
 #![feature(rustc_attrs)]
 #![feature(hash_raw_entry)]

From f9971c5cba0a141d3f00737292a40e3cacf44ac0 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 18:54:13 +0100
Subject: [PATCH 03/21] Remove unused feature gates from cg_llvm

Also turns a few `box` into `Box::new`
---
 src/librustc_codegen_llvm/lib.rs      | 15 ++++-----------
 src/librustc_codegen_llvm/metadata.rs |  4 ++--
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs
index 8091a74854070..98a3e695fa079 100644
--- a/src/librustc_codegen_llvm/lib.rs
+++ b/src/librustc_codegen_llvm/lib.rs
@@ -6,18 +6,11 @@
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(bool_to_option)]
-#![feature(box_patterns)]
-#![feature(box_syntax)]
 #![feature(const_cstr_unchecked)]
 #![feature(crate_visibility_modifier)]
 #![feature(extern_types)]
 #![feature(in_band_lifetimes)]
-#![feature(libc)]
 #![feature(nll)]
-#![feature(optin_builtin_traits)]
-#![feature(concat_idents)]
-#![feature(link_args)]
-#![feature(static_nobundle)]
 #![feature(trusted_len)]
 #![recursion_limit = "256"]
 
@@ -196,7 +189,7 @@ unsafe impl Sync for LlvmCodegenBackend {}
 
 impl LlvmCodegenBackend {
     pub fn new() -> Box<dyn CodegenBackend> {
-        box LlvmCodegenBackend(())
+        Box::new(LlvmCodegenBackend(()))
     }
 }
 
@@ -245,7 +238,7 @@ impl CodegenBackend for LlvmCodegenBackend {
     }
 
     fn metadata_loader(&self) -> Box<MetadataLoaderDyn> {
-        box metadata::LlvmMetadataLoader
+        Box::new(metadata::LlvmMetadataLoader)
     }
 
     fn provide(&self, providers: &mut ty::query::Providers<'_>) {
@@ -262,12 +255,12 @@ impl CodegenBackend for LlvmCodegenBackend {
         metadata: EncodedMetadata,
         need_metadata_module: bool,
     ) -> Box<dyn Any> {
-        box rustc_codegen_ssa::base::codegen_crate(
+        Box::new(rustc_codegen_ssa::base::codegen_crate(
             LlvmCodegenBackend(()),
             tcx,
             metadata,
             need_metadata_module,
-        )
+        ))
     }
 
     fn join_codegen(
diff --git a/src/librustc_codegen_llvm/metadata.rs b/src/librustc_codegen_llvm/metadata.rs
index abe34bb148ce5..36b12f1a7b184 100644
--- a/src/librustc_codegen_llvm/metadata.rs
+++ b/src/librustc_codegen_llvm/metadata.rs
@@ -22,7 +22,7 @@ impl MetadataLoader for LlvmMetadataLoader {
         // Use ArchiveRO for speed here, it's backed by LLVM and uses mmap
         // internally to read the file. We also avoid even using a memcpy by
         // just keeping the archive along while the metadata is in use.
-        let archive = ArchiveRO::open(filename).map(|ar| OwningRef::new(box ar)).map_err(|e| {
+        let archive = ArchiveRO::open(filename).map(|ar| OwningRef::new(Box::new(ar))).map_err(|e| {
             debug!("llvm didn't like `{}`: {}", filename.display(), e);
             format!("failed to read rlib metadata in '{}': {}", filename.display(), e)
         })?;
@@ -44,7 +44,7 @@ impl MetadataLoader for LlvmMetadataLoader {
             let buf = path_to_c_string(filename);
             let mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(buf.as_ptr())
                 .ok_or_else(|| format!("error reading library: '{}'", filename.display()))?;
-            let of = ObjectFile::new(mb).map(|of| OwningRef::new(box of)).ok_or_else(|| {
+            let of = ObjectFile::new(mb).map(|of| OwningRef::new(Box::new(of))).ok_or_else(|| {
                 format!("provided path not an object file: '{}'", filename.display())
             })?;
             let buf = of.try_map(|of| search_meta_section(of, target, filename))?;

From c2da8b3f0d669cb5d6e7d1338aed91fd1c76b8a3 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:04:56 +0100
Subject: [PATCH 04/21] Remove unused feature gates from cg_ssa and cg_utils

---
 src/librustc_codegen_ssa/lib.rs   | 4 ----
 src/librustc_codegen_utils/lib.rs | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/src/librustc_codegen_ssa/lib.rs b/src/librustc_codegen_ssa/lib.rs
index f39587122c56d..a2bb39b9e4019 100644
--- a/src/librustc_codegen_ssa/lib.rs
+++ b/src/librustc_codegen_ssa/lib.rs
@@ -1,10 +1,6 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(bool_to_option)]
 #![feature(box_patterns)]
-#![feature(box_syntax)]
-#![feature(core_intrinsics)]
-#![feature(libc)]
-#![feature(stmt_expr_attributes)]
 #![feature(try_blocks)]
 #![feature(in_band_lifetimes)]
 #![feature(nll)]
diff --git a/src/librustc_codegen_utils/lib.rs b/src/librustc_codegen_utils/lib.rs
index 6b802bf530e86..38906bbaef810 100644
--- a/src/librustc_codegen_utils/lib.rs
+++ b/src/librustc_codegen_utils/lib.rs
@@ -3,10 +3,6 @@
 //! This API is completely unstable and subject to change.
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
-#![feature(arbitrary_self_types)]
-#![feature(box_patterns)]
-#![feature(box_syntax)]
-#![feature(core_intrinsics)]
 #![feature(never_type)]
 #![feature(nll)]
 #![feature(in_band_lifetimes)]

From 2a4596abfb4449371982c824c330e30f4ae0d1ee Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:08:28 +0100
Subject: [PATCH 05/21] Remove unused feature gates from
 librustc_data_structures

---
 src/librustc_data_structures/lib.rs | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index aaac7fb4460cd..13792a0c890c4 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -12,7 +12,6 @@
 #![feature(generators)]
 #![feature(generator_trait)]
 #![feature(fn_traits)]
-#![feature(unsize)]
 #![feature(specialization)]
 #![feature(optin_builtin_traits)]
 #![feature(nll)]
@@ -20,11 +19,9 @@
 #![feature(hash_raw_entry)]
 #![feature(stmt_expr_attributes)]
 #![feature(core_intrinsics)]
-#![feature(integer_atomics)]
 #![feature(test)]
 #![feature(associated_type_bounds)]
 #![feature(thread_id_value)]
-#![cfg_attr(unix, feature(libc))]
 #![allow(rustc::default_hash_types)]
 
 #[macro_use]

From cf862df494438923295ae4ca78b40787c6b89d53 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:10:39 +0100
Subject: [PATCH 06/21] Remove unused feature gates from librustc_driver

---
 src/librustc_driver/lib.rs | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 019ff431bcb97..52c6399498534 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -5,12 +5,7 @@
 //! This API is completely unstable and subject to change.
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
-#![feature(box_syntax)]
-#![cfg_attr(unix, feature(libc))]
 #![feature(nll)]
-#![feature(set_stdio)]
-#![feature(no_debug)]
-#![feature(integer_atomics)]
 #![recursion_limit = "256"]
 
 pub extern crate getopts;

From 3e61d52784bd20140a8124d41a9661378b65f40e Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:11:41 +0100
Subject: [PATCH 07/21] Remove unused feature gates from librustc_errors

---
 src/librustc_errors/lib.rs | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 17b293401f89e..109b151e4140b 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -4,9 +4,7 @@
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(crate_visibility_modifier)]
-#![cfg_attr(unix, feature(libc))]
 #![feature(nll)]
-#![feature(optin_builtin_traits)]
 
 pub use emitter::ColorConfig;
 

From d252791a93b7ad26c9af63b68d223164a3678e8e Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:14:21 +0100
Subject: [PATCH 08/21] Remove unused feature gate from librustc_incremental

---
 src/librustc_incremental/lib.rs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs
index 7ce4def2886b8..ca824fde7efc1 100644
--- a/src/librustc_incremental/lib.rs
+++ b/src/librustc_incremental/lib.rs
@@ -3,7 +3,6 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(in_band_lifetimes)]
 #![feature(nll)]
-#![feature(specialization)]
 #![recursion_limit = "256"]
 
 #[macro_use]

From 6638b867022fb1d2a56b6ed5f899e9fd00183396 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:18:04 +0100
Subject: [PATCH 09/21] Remove unused feature gates from librustc_interface

---
 src/librustc_interface/lib.rs | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/librustc_interface/lib.rs b/src/librustc_interface/lib.rs
index e4e6849ab8e59..ba1e2216ca805 100644
--- a/src/librustc_interface/lib.rs
+++ b/src/librustc_interface/lib.rs
@@ -2,10 +2,8 @@
 #![feature(box_syntax)]
 #![feature(set_stdio)]
 #![feature(nll)]
-#![feature(arbitrary_self_types)]
 #![feature(generator_trait)]
 #![feature(generators)]
-#![cfg_attr(unix, feature(libc))]
 #![recursion_limit = "256"]
 
 #[cfg(unix)]

From 74994af266a83edb9f82f8175de0c5c84bd849a0 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:19:03 +0100
Subject: [PATCH 10/21] Remove unused feature gate from librustc_lint

---
 src/librustc_lint/lib.rs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs
index 78e9d0f14f2de..6e2db65c84005 100644
--- a/src/librustc_lint/lib.rs
+++ b/src/librustc_lint/lib.rs
@@ -28,7 +28,6 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![cfg_attr(test, feature(test))]
 #![feature(bool_to_option)]
-#![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(crate_visibility_modifier)]
 #![feature(never_type)]

From 6305c683cb63a3a83641aaf4ec763c290fc52b0c Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 19:51:00 +0100
Subject: [PATCH 11/21] Remove unused feature gates from librustc_metadata

---
 src/librustc_metadata/lib.rs | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs
index d94f23ff8bc6a..d4cc3c32616ac 100644
--- a/src/librustc_metadata/lib.rs
+++ b/src/librustc_metadata/lib.rs
@@ -1,15 +1,11 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(bool_to_option)]
-#![feature(box_patterns)]
 #![feature(core_intrinsics)]
 #![feature(crate_visibility_modifier)]
 #![feature(drain_filter)]
 #![feature(in_band_lifetimes)]
-#![feature(libc)]
 #![feature(nll)]
 #![feature(proc_macro_internals)]
-#![feature(proc_macro_quote)]
-#![feature(rustc_private)]
 #![feature(specialization)]
 #![feature(stmt_expr_attributes)]
 #![recursion_limit = "256"]

From 341594e1969795e4d48840ec48f0d6309ea0fa3a Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 20:04:44 +0100
Subject: [PATCH 12/21] Remove unused feature gates from librustc_mir

---
 src/librustc_mir/lib.rs | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs
index f064869d66471..4f1b90e34cf00 100644
--- a/src/librustc_mir/lib.rs
+++ b/src/librustc_mir/lib.rs
@@ -6,21 +6,15 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
 
 #![feature(nll)]
 #![feature(in_band_lifetimes)]
-#![feature(inner_deref)]
 #![feature(bool_to_option)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(crate_visibility_modifier)]
-#![feature(core_intrinsics)]
-#![feature(decl_macro)]
 #![feature(drain_filter)]
 #![feature(exhaustive_patterns)]
 #![feature(iter_order_by)]
 #![feature(never_type)]
 #![feature(specialization)]
-#![feature(try_trait)]
-#![feature(unicode_internals)]
-#![feature(slice_concat_ext)]
 #![feature(trusted_len)]
 #![feature(try_blocks)]
 #![feature(associated_type_bounds)]

From 1bfba4fbce25ac02a8023a817eee2c539c47c37e Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 20:08:15 +0100
Subject: [PATCH 13/21] Remove unused feature gate from librustc_resolve

---
 src/librustc_resolve/lib.rs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index af4ba4c0eb20e..2e63c3e170605 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -9,7 +9,6 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(bool_to_option)]
 #![feature(crate_visibility_modifier)]
-#![feature(label_break_value)]
 #![feature(nll)]
 #![recursion_limit = "256"]
 

From 1a26c1c67acd9360bed7121b917581c9d69fc214 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 20:09:43 +0100
Subject: [PATCH 14/21] Remove unused feature gate from librustc_target

---
 src/librustc_target/lib.rs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/librustc_target/lib.rs b/src/librustc_target/lib.rs
index a9db0254a7d11..71150e74f70d4 100644
--- a/src/librustc_target/lib.rs
+++ b/src/librustc_target/lib.rs
@@ -8,7 +8,6 @@
 //! LLVM.
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
-#![feature(box_syntax)]
 #![feature(bool_to_option)]
 #![feature(nll)]
 

From 8f672cd7dd9139947feb6b04f8b20dc27735dcc9 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 20:12:28 +0100
Subject: [PATCH 15/21] Remove unused feature gates from librustc_typeck

---
 src/librustc_typeck/lib.rs | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs
index 05ea9b1ac56dc..474868f0dd6c4 100644
--- a/src/librustc_typeck/lib.rs
+++ b/src/librustc_typeck/lib.rs
@@ -58,10 +58,8 @@ This API is completely unstable and subject to change.
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![allow(non_camel_case_types)]
 #![feature(bool_to_option)]
-#![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(crate_visibility_modifier)]
-#![feature(exhaustive_patterns)]
 #![feature(in_band_lifetimes)]
 #![feature(nll)]
 #![feature(try_blocks)]

From b7599990d492e2650f343ab61e1ce5d390996284 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 20:14:27 +0100
Subject: [PATCH 16/21] Remove unused feature gates from librustdoc

---
 src/librustdoc/lib.rs | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index ed3f0f94e0ed8..4e0a2d9427431 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -3,19 +3,15 @@
     html_playground_url = "https://play.rust-lang.org/"
 )]
 #![feature(rustc_private)]
-#![feature(arbitrary_self_types)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(in_band_lifetimes)]
 #![feature(nll)]
-#![feature(set_stdio)]
 #![feature(test)]
 #![feature(vec_remove_item)]
 #![feature(ptr_offset_from)]
 #![feature(crate_visibility_modifier)]
-#![feature(drain_filter)]
 #![feature(never_type)]
-#![feature(unicode_internals)]
 #![recursion_limit = "256"]
 
 extern crate env_logger;

From 9d6bdccd9e835c46de1f703a31cb00ccfeab9e84 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 20:15:15 +0100
Subject: [PATCH 17/21] Remove unused feature gate from libserialize

---
 src/libserialize/lib.rs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs
index 280fb078f7de4..b990e71bef0dd 100644
--- a/src/libserialize/lib.rs
+++ b/src/libserialize/lib.rs
@@ -10,7 +10,6 @@ Core encoding and decoding interfaces.
     test(attr(allow(unused_variables), deny(warnings)))
 )]
 #![feature(box_syntax)]
-#![feature(core_intrinsics)]
 #![feature(specialization)]
 #![feature(never_type)]
 #![feature(nll)]

From 91d01e7c6b3c646a183f9f0caab53b696b3feea8 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 17 Nov 2019 20:17:38 +0100
Subject: [PATCH 18/21] Remove unused feature gates from libsyntax_pos

---
 src/librustc_span/lib.rs | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/librustc_span/lib.rs b/src/librustc_span/lib.rs
index 413bd77daae24..ac9c3360b860d 100644
--- a/src/librustc_span/lib.rs
+++ b/src/librustc_span/lib.rs
@@ -8,9 +8,6 @@
 #![feature(crate_visibility_modifier)]
 #![feature(nll)]
 #![feature(optin_builtin_traits)]
-#![feature(rustc_attrs)]
-#![feature(specialization)]
-#![feature(step_trait)]
 
 use rustc_data_structures::AtomicRef;
 use rustc_macros::HashStable_Generic;

From e38665676b291eeacf1b9ba54a476588da1230c1 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Mon, 23 Dec 2019 16:26:53 +0100
Subject: [PATCH 19/21] Rustfmt

---
 src/librustc_codegen_llvm/metadata.rs | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/librustc_codegen_llvm/metadata.rs b/src/librustc_codegen_llvm/metadata.rs
index 36b12f1a7b184..0f30c2c020de7 100644
--- a/src/librustc_codegen_llvm/metadata.rs
+++ b/src/librustc_codegen_llvm/metadata.rs
@@ -22,10 +22,11 @@ impl MetadataLoader for LlvmMetadataLoader {
         // Use ArchiveRO for speed here, it's backed by LLVM and uses mmap
         // internally to read the file. We also avoid even using a memcpy by
         // just keeping the archive along while the metadata is in use.
-        let archive = ArchiveRO::open(filename).map(|ar| OwningRef::new(Box::new(ar))).map_err(|e| {
-            debug!("llvm didn't like `{}`: {}", filename.display(), e);
-            format!("failed to read rlib metadata in '{}': {}", filename.display(), e)
-        })?;
+        let archive =
+            ArchiveRO::open(filename).map(|ar| OwningRef::new(Box::new(ar))).map_err(|e| {
+                debug!("llvm didn't like `{}`: {}", filename.display(), e);
+                format!("failed to read rlib metadata in '{}': {}", filename.display(), e)
+            })?;
         let buf: OwningRef<_, [u8]> = archive.try_map(|ar| {
             ar.iter()
                 .filter_map(|s| s.ok())
@@ -44,9 +45,10 @@ impl MetadataLoader for LlvmMetadataLoader {
             let buf = path_to_c_string(filename);
             let mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(buf.as_ptr())
                 .ok_or_else(|| format!("error reading library: '{}'", filename.display()))?;
-            let of = ObjectFile::new(mb).map(|of| OwningRef::new(Box::new(of))).ok_or_else(|| {
-                format!("provided path not an object file: '{}'", filename.display())
-            })?;
+            let of =
+                ObjectFile::new(mb).map(|of| OwningRef::new(Box::new(of))).ok_or_else(|| {
+                    format!("provided path not an object file: '{}'", filename.display())
+                })?;
             let buf = of.try_map(|of| search_meta_section(of, target, filename))?;
             Ok(rustc_erase_owner!(buf))
         }

From 5827d78f18ce688a96ecd5a20defda07c8834936 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sat, 25 Jan 2020 12:13:14 +0100
Subject: [PATCH 20/21] Fix test

---
 src/test/ui/consts/miri_unleashed/mutable_const2.stderr | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/ui/consts/miri_unleashed/mutable_const2.stderr b/src/test/ui/consts/miri_unleashed/mutable_const2.stderr
index a316d8f1698ac..3eb8e0ec18288 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_const2.stderr
+++ b/src/test/ui/consts/miri_unleashed/mutable_const2.stderr
@@ -10,7 +10,7 @@ error: internal compiler error: mutable allocation in constant
 LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:357:17
+thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:355:17
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 
 error: internal compiler error: unexpected panic

From 3e57a0afb57decd347fe9133dd3d37dd0fb5dbec Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sun, 9 Feb 2020 19:52:42 +0100
Subject: [PATCH 21/21] Update for #68718

---
 src/librustc_span/lib.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/librustc_span/lib.rs b/src/librustc_span/lib.rs
index ac9c3360b860d..2e149c96b9123 100644
--- a/src/librustc_span/lib.rs
+++ b/src/librustc_span/lib.rs
@@ -8,6 +8,7 @@
 #![feature(crate_visibility_modifier)]
 #![feature(nll)]
 #![feature(optin_builtin_traits)]
+#![feature(specialization)]
 
 use rustc_data_structures::AtomicRef;
 use rustc_macros::HashStable_Generic;