Skip to content

LLVM changed the nocapture attribute to captures(none) #136287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use Attribute::getWithCaptureInfo
  • Loading branch information
zmodem committed Jan 30, 2025
commit 6e457b88eb6058267794ab6dbf595cf8f183368c
3 changes: 1 addition & 2 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ LLVMRustCreateAttrNoValue(LLVMContextRef C, LLVMRustAttributeKind RustAttr) {
#if LLVM_VERSION_GE(21, 0)
// LLVM 21 replaced the NoCapture attribute with Captures(none).
if (RustAttr == LLVMRustAttributeKind::NoCapture) {
return wrap(Attribute::get(*unwrap(C), Attribute::Captures,
CaptureInfo::none().toIntValue()));
return wrap(Attribute::getWithCaptureInfo(*unwrap(C), CaptureInfo::none()));
}
#endif
return wrap(Attribute::get(*unwrap(C), fromRust(RustAttr)));
Expand Down
Loading