diff options
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/common.rs')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/common.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_ssa/src/common.rs b/compiler/rustc_codegen_ssa/src/common.rs index 94c63b98ff9..1574b30497b 100644 --- a/compiler/rustc_codegen_ssa/src/common.rs +++ b/compiler/rustc_codegen_ssa/src/common.rs @@ -119,17 +119,10 @@ mod temp_stable_hash_impls { pub fn build_langcall<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( bx: &Bx, span: Option<Span>, - msg: &str, li: LangItem, ) -> (Bx::FnAbiOfResult, Bx::Value) { let tcx = bx.tcx(); - let def_id = tcx.lang_items().require(li).unwrap_or_else(|s| { - let msg = format!("{} {}", msg, s); - match span { - Some(span) => tcx.sess.span_fatal(span, &msg), - None => tcx.sess.fatal(&msg), - } - }); + let def_id = tcx.require_lang_item(li, span); let instance = ty::Instance::mono(tcx, def_id); (bx.fn_abi_of_instance(instance, ty::List::empty()), bx.get_fn_addr(instance)) } |
