about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-10-15 10:34:13 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2020-10-15 10:34:13 +0200
commita233646dfcaf74bd99b97e950df724b03b878ed1 (patch)
treeb08689e398f59708ef5433316fdf70cee34f53ff
parent6258b86c40b615fbba45d4e29412b6458500f5ca (diff)
downloadrust-a233646dfcaf74bd99b97e950df724b03b878ed1.tar.gz
rust-a233646dfcaf74bd99b97e950df724b03b878ed1.zip
Rustup to rustc 1.49.0-nightly (e160e5cb8 2020-10-14)
-rw-r--r--patches/0022-core-Disable-not-compiling-tests.patch2
-rw-r--r--rust-toolchain2
-rw-r--r--src/base.rs24
-rw-r--r--src/driver/aot.rs1
-rw-r--r--src/lib.rs45
5 files changed, 21 insertions, 53 deletions
diff --git a/patches/0022-core-Disable-not-compiling-tests.patch b/patches/0022-core-Disable-not-compiling-tests.patch
index 009b2fed0f9..ee8548783de 100644
--- a/patches/0022-core-Disable-not-compiling-tests.patch
+++ b/patches/0022-core-Disable-not-compiling-tests.patch
@@ -112,7 +112,7 @@ index 6609bc3..241b497 100644
  #[cfg(not(target_arch = "wasm32"))]
  fn sort_unstable() {
 @@ -1394,6 +1395,7 @@ fn partition_at_index() {
-     v.partition_at_index(0);
+     v.select_nth_unstable(0);
      assert!(v == [0xDEADBEEF]);
  }
 +*/
diff --git a/rust-toolchain b/rust-toolchain
index d9e199b78ff..ab4c3c84c96 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1 +1 @@
-nightly-2020-10-12
+nightly-2020-10-15
diff --git a/src/base.rs b/src/base.rs
index 9f558bc7520..fa9b8853d39 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -299,19 +299,19 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Module>) {
             TerminatorKind::SwitchInt {
                 discr,
                 switch_ty,
-                values,
                 targets,
             } => {
                 let discr = trans_operand(fx, discr).load_scalar(fx);
 
                 if switch_ty.kind() == fx.tcx.types.bool.kind() {
-                    assert_eq!(targets.len(), 2);
-                    let then_block = fx.get_block(targets[0]);
-                    let else_block = fx.get_block(targets[1]);
-                    let test_zero = match **values {
-                        [0] => true,
-                        [1] => false,
-                        _ => unreachable!("{:?}", values),
+                    assert_eq!(targets.iter().count(), 1);
+                    let (then_value, then_block) = targets.iter().next().unwrap();
+                    let then_block = fx.get_block(then_block);
+                    let else_block = fx.get_block(targets.otherwise());
+                    let test_zero = match then_value {
+                        0 => true,
+                        1 => false,
+                        _ => unreachable!("{:?}", targets),
                     };
 
                     let discr = crate::optimize::peephole::maybe_unwrap_bint(&mut fx.bcx, discr);
@@ -330,11 +330,11 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Module>) {
                     }
                 } else {
                     let mut switch = ::cranelift_frontend::Switch::new();
-                    for (i, value) in values.iter().enumerate() {
-                        let block = fx.get_block(targets[i]);
-                        switch.set_entry(*value, block);
+                    for (value, block) in targets.iter() {
+                        let block = fx.get_block(block);
+                        switch.set_entry(value, block);
                     }
-                    let otherwise_block = fx.get_block(targets[targets.len() - 1]);
+                    let otherwise_block = fx.get_block(targets.otherwise());
                     switch.emit(&mut fx.bcx, discr, otherwise_block);
                 }
             }
diff --git a/src/driver/aot.rs b/src/driver/aot.rs
index 2b3d1b7885d..e7595abe178 100644
--- a/src/driver/aot.rs
+++ b/src/driver/aot.rs
@@ -302,7 +302,6 @@ pub(super) fn run_aot(
             modules,
             allocator_module,
             metadata_module,
-            crate_hash: tcx.crate_hash(LOCAL_CRATE),
             metadata,
             windows_subsystem: None, // Windows is not yet supported
             linker_info: LinkerInfo::new(tcx),
diff --git a/src/lib.rs b/src/lib.rs
index 2fa4f9e0ead..af359456e69 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -37,7 +37,7 @@ use std::any::Any;
 use rustc_codegen_ssa::traits::CodegenBackend;
 use rustc_codegen_ssa::CodegenResults;
 use rustc_errors::ErrorReported;
-use rustc_middle::dep_graph::{DepGraph, WorkProduct, WorkProductId};
+use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
 use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader};
 use rustc_middle::ty::query::Providers;
 use rustc_session::config::OutputFilenames;
@@ -190,23 +190,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
         Box::new(crate::metadata::CraneliftMetadataLoader)
     }
 
-    fn provide(&self, providers: &mut Providers) {
-        providers.supported_target_features = |tcx, cnum| {
-            assert_eq!(cnum, LOCAL_CRATE);
-            if tcx.sess.opts.actually_rustdoc {
-                // rustdoc needs to be able to document functions that use all the features, so
-                // whitelist them all
-                rustc_codegen_ssa::target_features::all_known_features()
-                    .map(|(a, b)| (a.to_string(), b))
-                    .collect()
-            } else {
-                rustc_codegen_ssa::target_features::supported_target_features(tcx.sess)
-                    .iter()
-                    .map(|&(a, b)| (a.to_string(), b))
-                    .collect()
-            }
-        };
-    }
+    fn provide(&self, _providers: &mut Providers) {}
     fn provide_extern(&self, _providers: &mut Providers) {}
 
     fn target_features(&self, _sess: &Session) -> Vec<rustc_span::Symbol> {
@@ -229,34 +213,21 @@ impl CodegenBackend for CraneliftCodegenBackend {
     fn join_codegen(
         &self,
         ongoing_codegen: Box<dyn Any>,
-        sess: &Session,
-        dep_graph: &DepGraph,
-    ) -> Result<Box<dyn Any>, ErrorReported> {
-        let (codegen_results, work_products) = *ongoing_codegen
+        _sess: &Session,
+    ) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
+        Ok(*ongoing_codegen
             .downcast::<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>)>()
-            .unwrap();
-
-        sess.time("serialize_work_products", move || {
-            rustc_incremental::save_work_product_index(sess, &dep_graph, work_products)
-        });
-
-        Ok(Box::new(codegen_results))
+            .unwrap())
     }
 
     fn link(
         &self,
         sess: &Session,
-        res: Box<dyn Any>,
+        codegen_results: CodegenResults,
         outputs: &OutputFilenames,
     ) -> Result<(), ErrorReported> {
         use rustc_codegen_ssa::back::link::link_binary;
 
-        sess.abort_if_errors();
-
-        let codegen_results = *res
-            .downcast::<CodegenResults>()
-            .expect("Expected CraneliftCodegenBackend's CodegenResult, found Box<Any>");
-
         let _timer = sess.prof.generic_activity("link_crate");
 
         sess.time("linking", || {
@@ -270,8 +241,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
             );
         });
 
-        rustc_incremental::finalize_session_directory(sess, codegen_results.crate_hash);
-
         Ok(())
     }
 }