use Attribute::getWithCaptureInfo

This commit is contained in:
Hans Wennborg 2025-01-30 12:30:14 +01:00
parent 23fb08bb53
commit 6e457b88eb

View File

@ -438,8 +438,7 @@ LLVMRustCreateAttrNoValue(LLVMContextRef C, LLVMRustAttributeKind RustAttr) {
#if LLVM_VERSION_GE(21, 0) #if LLVM_VERSION_GE(21, 0)
// LLVM 21 replaced the NoCapture attribute with Captures(none). // LLVM 21 replaced the NoCapture attribute with Captures(none).
if (RustAttr == LLVMRustAttributeKind::NoCapture) { if (RustAttr == LLVMRustAttributeKind::NoCapture) {
return wrap(Attribute::get(*unwrap(C), Attribute::Captures, return wrap(Attribute::getWithCaptureInfo(*unwrap(C), CaptureInfo::none()));
CaptureInfo::none().toIntValue()));
} }
#endif #endif
return wrap(Attribute::get(*unwrap(C), fromRust(RustAttr))); return wrap(Attribute::get(*unwrap(C), fromRust(RustAttr)));