diff options
| author | The rustc-josh-sync Cronjob Bot <github-actions@github.com> | 2025-09-22 04:19:52 +0000 |
|---|---|---|
| committer | The rustc-josh-sync Cronjob Bot <github-actions@github.com> | 2025-09-22 04:19:52 +0000 |
| commit | c3d30743a4d5cb71c2df9f438787beb207df3078 (patch) | |
| tree | ee9b4d0fceaff1308f1f7acdfc88be49c6cbced2 /src/tools/miri/genmc-sys/cpp/include/ResultHandling.hpp | |
| parent | 5658b39397d2667ed8c51ef6b5c52f562af4415e (diff) | |
| parent | 9f32ccf35fb877270bc44a86a126440f04d676d0 (diff) | |
Merge ref '9f32ccf35fb8' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 9f32ccf35fb877270bc44a86a126440f04d676d0 Filtered ref: 87b13773969f65eec6762cfe4194954e7513f59b Upstream diff: https://github.com/rust-lang/rust/compare/2f3f27bf79ec147fec9d2e7980605307a74067f4...9f32ccf35fb877270bc44a86a126440f04d676d0 This merge was created using https://github.com/rust-lang/josh-sync.
Diffstat (limited to 'src/tools/miri/genmc-sys/cpp/include/ResultHandling.hpp')
| -rw-r--r-- | src/tools/miri/genmc-sys/cpp/include/ResultHandling.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tools/miri/genmc-sys/cpp/include/ResultHandling.hpp b/src/tools/miri/genmc-sys/cpp/include/ResultHandling.hpp new file mode 100644 index 00000000000..189f32e6f51 --- /dev/null +++ b/src/tools/miri/genmc-sys/cpp/include/ResultHandling.hpp @@ -0,0 +1,21 @@ +#ifndef GENMC_RESULT_HANDLING_HPP +#define GENMC_RESULT_HANDLING_HPP + +// CXX.rs generated headers: +#include "rust/cxx.h" + +// GenMC headers: +#include "Verification/VerificationError.hpp" + +#include <string> + +/** Information about an error, formatted as a string to avoid having to share an error enum and + * printing functionality with the Rust side. */ +static auto format_error(VerificationError err) -> std::unique_ptr<std::string> { + auto buf = std::string(); + auto s = llvm::raw_string_ostream(buf); + s << err; + return std::make_unique<std::string>(s.str()); +} + +#endif /* GENMC_RESULT_HANDLING_HPP */ |
