about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorSmitty <me@smitop.com>2021-07-03 11:14:19 -0400
committerSmitty <me@smitop.com>2021-07-03 11:14:19 -0400
commitb201b2f65f64e7595ae1bfa19f6a8b3c354b9f9d (patch)
tree2a2bc8a83e4b8a74705adaf84f6126075ca0a76b /compiler/rustc_codegen_ssa/src
parente9d69d9f8eb888a6e124c567f804c2e464c7b00a (diff)
downloadrust-b201b2f65f64e7595ae1bfa19f6a8b3c354b9f9d.tar.gz
rust-b201b2f65f64e7595ae1bfa19f6a8b3c354b9f9d.zip
Make vtable_allocation always succeed
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/meth.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/meth.rs b/compiler/rustc_codegen_ssa/src/meth.rs
index fcaafb94cfd..63245a94c8e 100644
--- a/compiler/rustc_codegen_ssa/src/meth.rs
+++ b/compiler/rustc_codegen_ssa/src/meth.rs
@@ -70,10 +70,7 @@ pub fn get_vtable<'tcx, Cx: CodegenMethods<'tcx>>(
         return val;
     }
 
-    let vtable_alloc_id = match tcx.vtable_allocation(ty, trait_ref) {
-        Ok(alloc) => alloc,
-        Err(_) => tcx.sess.fatal("allocation of constant vtable failed"),
-    };
+    let vtable_alloc_id = tcx.vtable_allocation(ty, trait_ref);
     let vtable_allocation = tcx.global_alloc(vtable_alloc_id).unwrap_memory();
     let vtable_const = cx.const_data_from_alloc(vtable_allocation);
     let align = cx.data_layout().pointer_align.abi;