Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4ee7222

Browse files
committedMar 11, 2025
Use TyCtxt::is_lang_item
1 parent d08b797 commit 4ee7222

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎compiler/rustc_codegen_llvm/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ fn check_and_apply_linkage<'ll, 'tcx>(
180180
// instead of an extern_weak i8.
181181
let instance = Instance::mono(cx.tcx, def_id);
182182
if let ty::Adt(struct_def, generic_args) = instance.ty(cx.tcx, cx.typing_env()).kind()
183-
&& let Some(LangItem::Option) = cx.tcx.lang_items().from_def_id(struct_def.did())
183+
&& cx.tcx.is_lang_item(struct_def.did(), LangItem::Option)
184184
&& let Some(first_arg) = generic_args.first()
185185
&& let ty::FnPtr(sig, header) = first_arg.expect_ty().kind()
186186
{

0 commit comments

Comments
 (0)
Failed to load comments.