]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: proc_macro: Increase FFIString usage
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 26 Jul 2023 13:26:55 +0000 (15:26 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:55:59 +0000 (18:55 +0100)
commitf00f3837ef1317b46a6b1a458140e98d0d18fd4d
tree4ec1d5dd50ee2280f4983dc09c746fc2ca59e3aa
parentdd15fff38562ab8c3160190366f1e755c033425b
gccrs: proc_macro: Increase FFIString usage

Two remaining structures in the rust interface were still using raw
string pointer and length couples to communicate with the C++ library
throught extern C functions. Using FFIString instead allow us to reduce
the scope of potential errors using those raw pointers. As FFIString
encapsulate raw pointer operations there will be only one locaiton to
look after.

libgrust/ChangeLog:

* libproc_macro/rust/bridge/literal.rs: Change extern C
function argument from raw string pointer and length to
FFIString.
* libproc_macro/rust/bridge/token_stream.rs: Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
libgrust/libproc_macro/rust/bridge/literal.rs
libgrust/libproc_macro/rust/bridge/token_stream.rs