diff options
Diffstat (limited to 'libgrust')
-rw-r--r-- | libgrust/libproc_macro/rust/bridge/token_stream.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libgrust/libproc_macro/rust/bridge/token_stream.rs b/libgrust/libproc_macro/rust/bridge/token_stream.rs index 56f6679..79f161f 100644 --- a/libgrust/libproc_macro/rust/bridge/token_stream.rs +++ b/libgrust/libproc_macro/rust/bridge/token_stream.rs @@ -15,6 +15,7 @@ extern "C" { fn TokenStream__push(stream: *mut TokenStream, tree: TokenTree); fn TokenStream__from_string(str: *const c_uchar, len: u64, ts: *mut TokenStream) -> bool; fn TokenStream__clone(ts: *const TokenStream) -> TokenStream; + fn TokenStream__drop(stream: *mut TokenStream); } #[repr(C)] @@ -154,3 +155,9 @@ impl Clone for TokenStream { unsafe { TokenStream__clone(self as *const TokenStream) } } } + +impl Drop for TokenStream { + fn drop(&mut self) { + unsafe { TokenStream__drop(self as *mut TokenStream) } + } +} |