|
// Demangles symbol given in `mangled` argument into `out` buffer |
|
// |
|
// Returns 0 if `mangled` is not Rust symbol or if `out` buffer is too small |
|
// Returns 1 otherwise |
|
int rustc_demangle(const char *mangled, char *out, size_t out_size); |
|
|
shows that the same return code is used for both "not a rust symbol" and "too small buffer" in the C API. This is very unfortunate, as it makes it impossible to tell these cases apart.
This causes KDAB/hotspot#611 where hotspot will not demangle some long symbol names correctly. Consider making a breaking change (or adding an alternative function) whereby it is possible to tell these cases apart. Best would be if it would report how large the buffer would need to be.
rustc-demangle/crates/capi/include/rustc_demangle.h
Lines 8 to 13 in af38dc6
This causes KDAB/hotspot#611 where hotspot will not demangle some long symbol names correctly. Consider making a breaking change (or adding an alternative function) whereby it is possible to tell these cases apart. Best would be if it would report how large the buffer would need to be.