extern "C" LLVMRustArchiveIteratorRef
LLVMRustArchiveIteratorNew(LLVMRustArchiveRef RustArchive) {
Archive *Archive = RustArchive->getBinary();
+#if LLVM_VERSION_GE(10, 0)
+ std::unique_ptr<Error> Err = std::make_unique<Error>(Error::success());
+#else
std::unique_ptr<Error> Err = llvm::make_unique<Error>(Error::success());
+#endif
auto Cur = Archive->child_begin(*Err);
if (*Err) {
LLVMRustSetLastError(toString(std::move(*Err)).c_str());