luaur_compiler/methods/compile_error_what.rs
1use crate::records::compile_error::CompileError;
2use core::ffi::c_char;
3
4impl CompileError {
5 pub fn what(&self) -> *const c_char {
6 // NUL-terminated (see `CompileError::c_message`): `message.as_ptr()`
7 // would over-read in `CStr::from_ptr` since a Rust `String` has no NUL.
8 self.c_message.as_ptr()
9 }
10}