File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,7 @@ pub(super) fn write(out: &mut OutFile) {
255
255
}
256
256
257
257
if builtin. trycatch {
258
+ include. string = true ;
258
259
out. next_section ( ) ;
259
260
writeln ! ( out, "class Fail final {{" ) ;
260
261
writeln ! ( out, " ::rust::repr::PtrLen &throw$;" ) ;
@@ -264,6 +265,7 @@ pub(super) fn write(out: &mut OutFile) {
264
265
" Fail(::rust::repr::PtrLen &throw$) : throw$(throw$) {{}}"
265
266
) ;
266
267
writeln ! ( out, " void operator()(const char *) noexcept;" ) ;
268
+ writeln ! ( out, " void operator()(const std::string &) noexcept;" ) ;
267
269
writeln ! ( out, "}};" ) ;
268
270
}
269
271
Original file line number Diff line number Diff line change @@ -537,11 +537,16 @@ class Fail final {
537
537
public:
538
538
Fail (repr::PtrLen &throw $) : throw $(throw $) {}
539
539
void operator ()(const char *) noexcept ;
540
+ void operator ()(const std::string &) noexcept ;
540
541
};
541
542
542
543
void Fail::operator ()(const char *catch $) noexcept {
543
544
throw $ = cxxbridge1$exception (catch $, std::strlen (catch $));
544
545
}
546
+
547
+ void Fail::operator ()(const std::string &catch $) noexcept {
548
+ throw $ = cxxbridge1$exception (catch $.data (), catch $.length ());
549
+ }
545
550
} // namespace detail
546
551
547
552
} // namespace cxxbridge1
You can’t perform that action at this time.
0 commit comments