about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/vtable.rs
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-11-03 11:00:04 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-11-03 11:00:04 +0100
commit216c4ae46352330bc7962f132fe226a7e73ab8fa (patch)
treec1d7af49fa1f27f325f090cff3f2d8861972fec9 /compiler/rustc_codegen_cranelift/src/vtable.rs
parenta6403b0f04b58a35cb9f3e544b2847ee09bcf3a4 (diff)
parent03f01bbe901d60b71cf2c5ec766aef5e532ab79d (diff)
downloadrust-216c4ae46352330bc7962f132fe226a7e73ab8fa.tar.gz
rust-216c4ae46352330bc7962f132fe226a7e73ab8fa.zip
Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into update_cg_clif-2020-11-01
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/vtable.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/vtable.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/vtable.rs b/compiler/rustc_codegen_cranelift/src/vtable.rs
index bb3cf8b3f3a..238abc0d8bd 100644
--- a/compiler/rustc_codegen_cranelift/src/vtable.rs
+++ b/compiler/rustc_codegen_cranelift/src/vtable.rs
@@ -108,14 +108,14 @@ fn build_vtable<'tcx>(
         (&[]).iter()
     };
     let methods = methods.cloned().map(|opt_mth| {
-        opt_mth.map_or(None, |(def_id, substs)| {
-            Some(import_function(
+        opt_mth.map(|(def_id, substs)| {
+            import_function(
                 tcx,
                 &mut fx.cx.module,
                 Instance::resolve_for_vtable(tcx, ParamEnv::reveal_all(), def_id, substs)
                     .unwrap()
                     .polymorphize(fx.tcx),
-            ))
+            )
         })
     });
     components.extend(methods);
@@ -137,15 +137,7 @@ fn build_vtable<'tcx>(
         }
     }
 
-    data_ctx.set_align(
-        fx.tcx
-            .data_layout
-            .pointer_align
-            .pref
-            .bytes()
-            .try_into()
-            .unwrap(),
-    );
+    data_ctx.set_align(fx.tcx.data_layout.pointer_align.pref.bytes());
 
     let data_id = fx
         .cx