The rl_str! macro currently uses format!("{}\0", $expression).as_ptr() as *const i8, which produces a pointer to a temporary string. This can result in undefined behavior if the pointer outlives the macro expansion, as the temporary may be dropped before it is used by the FFI call.
The
rl_str!macro currently usesformat!("{}\0", $expression).as_ptr() as *const i8, which produces a pointer to a temporary string. This can result in undefined behavior if the pointer outlives the macro expansion, as the temporary may be dropped before it is used by the FFI call.