Skip to content

Commit 37cc63a

Browse files
authored
Rollup merge of rust-lang#46691 - varkor:contrib-3, r=rkruppe
Fix return value of `LLVMRustMetadataAsValue` `LLVMRustMetadataAsValue` would previously return `void`, despite the corresponding Rust function expecting to return a `ValueRef`.
2 parents 6a36541 + 6487ee3 commit 37cc63a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rustllvm/RustWrapper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ extern "C" void LLVMRustAddModuleFlag(LLVMModuleRef M, const char *Name,
566566
unwrap(M)->addModuleFlag(Module::Warning, Name, Value);
567567
}
568568

569-
extern "C" void LLVMRustMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD) {
570-
wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD)));
569+
extern "C" LLVMValueRef LLVMRustMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD) {
570+
return wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD)));
571571
}
572572

573573
extern "C" LLVMRustDIBuilderRef LLVMRustDIBuilderCreate(LLVMModuleRef M) {

0 commit comments

Comments
 (0)