Merge pull request #389 from dtolnay/error

Fill in Error base class constructor calls
This commit is contained in:
David Tolnay 2020-10-31 17:22:36 -07:00 committed by GitHub
commit e58f4270ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,9 +173,11 @@ const char *cxxbridge05$error(const char *ptr, size_t len) {
} // extern "C"
Error::Error(const Error &other)
: msg(cxxbridge05$error(other.msg, other.len)), len(other.len) {}
: std::exception(other), msg(cxxbridge05$error(other.msg, other.len)),
len(other.len) {}
Error::Error(Error &&other) noexcept : msg(other.msg), len(other.len) {
Error::Error(Error &&other) noexcept
: std::exception(std::move(other)), msg(other.msg), len(other.len) {
other.msg = nullptr;
other.len = 0;
}