about summary refs log tree commit diff
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
commit913c0bc01dbab632d1512f703c026aac7acfa197 (patch)
tree16b7cc29650aeb6e61e3ff5d55b2f9a53cbc95ee
parent17373a94018ee37365cc1c1c48e88372bb7c4283 (diff)
downloadrust-913c0bc01dbab632d1512f703c026aac7acfa197.tar.gz
rust-913c0bc01dbab632d1512f703c026aac7acfa197.zip
Make vtable_allocation always succeed
-rw-r--r--src/vtable.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/vtable.rs b/src/vtable.rs
index 7ee34b23e46..12f7092d935 100644
--- a/src/vtable.rs
+++ b/src/vtable.rs
@@ -72,10 +72,7 @@ pub(crate) fn get_vtable<'tcx>(
     let vtable_ptr = if let Some(vtable_ptr) = fx.vtables.get(&(ty, trait_ref)) {
         *vtable_ptr
     } else {
-        let vtable_alloc_id = match fx.tcx.vtable_allocation(ty, trait_ref) {
-            Ok(alloc) => alloc,
-            Err(_) => fx.tcx.sess.fatal("allocation of constant vtable failed"),
-        };
+        let vtable_alloc_id = fx.tcx.vtable_allocation(ty, trait_ref);
         let vtable_allocation = fx.tcx.global_alloc(vtable_alloc_id).unwrap_memory();
         let vtable_ptr = pointer_for_allocation(fx, vtable_allocation);