Skip to content

Commit dbb4178

Browse files
committed
[LLVM-3.9] Update return type for Archive::create
Changed in rust-lang/llvm@0b21d88
1 parent 8433f9b commit dbb4178

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rustllvm/ArchiveWrapper.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,19 @@ LLVMRustOpenArchive(char *path) {
4343
return nullptr;
4444
}
4545

46+
#if LLVM_VERSION_MINOR <= 8
4647
ErrorOr<std::unique_ptr<Archive>> archive_or =
48+
#else
49+
Expected<std::unique_ptr<Archive>> archive_or =
50+
#endif
4751
Archive::create(buf_or.get()->getMemBufferRef());
4852

4953
if (!archive_or) {
54+
#if LLVM_VERSION_MINOR <= 8
5055
LLVMRustSetLastError(archive_or.getError().message().c_str());
56+
#else
57+
LLVMRustSetLastError(toString(archive_or.takeError()).c_str());
58+
#endif
5159
return nullptr;
5260
}
5361

0 commit comments

Comments
 (0)