Nix/src/libutil/rust-ffi.cc

19 lines
374 B
C++
Raw Normal View History

#include "logging.hh"
2019-09-11 13:10:46 +02:00
#include "rust-ffi.hh"
extern "C" std::exception_ptr * make_error(rust::StringSlice s)
{
// FIXME: leak
return new std::exception_ptr(std::make_exception_ptr(nix::Error(std::string(s.ptr, s.size))));
}
namespace rust {
std::ostream & operator << (std::ostream & str, const String & s)
{
str << (std::string_view) s;
return str;
}
}