Skip to content

Commit 41ce4f2

Browse files
committed
Generate all functions in one impl block
1 parent 088dfcf commit 41ce4f2

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

src/raw.rs

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,6 @@ macro_rules! make_func {
196196

197197
/// Defines an associated function within a given type.
198198
/// <sup>**[tt-call]**</sup>
199-
macro_rules! make_impl_func {
200-
{
201-
type = [{ $type:ty }]
202-
lifetime = [{ $( $( $life:lifetime ),+ )? }]
203-
$( $rest:tt )*
204-
} => {
205-
impl $( < $( $life ),+ > )? $type {
206-
make_func! {
207-
$( $rest )*
208-
}
209-
}
210-
};
211-
}
212-
213199
/// Defines an associated function for `JitState` for each `jit_entry`.
214200
macro_rules! jit_entry {
215201
( $entry:ident( $enum_in:ident $(, $inarg:ident )* )
@@ -220,9 +206,7 @@ macro_rules! jit_entry {
220206
tt_call! {
221207
macro = [{ jit_signature }]
222208
suffix = [{ $entry }]
223-
~~> make_impl_func! {
224-
type = [{ JitState<'j> }]
225-
lifetime = [{ 'j }]
209+
~~> make_func! {
226210
func = [{ $entry }]
227211
body = [{
228212
JitNode {
@@ -244,9 +228,7 @@ macro_rules! jit_entry {
244228
tt_call! {
245229
macro = [{ jit_signature }]
246230
suffix = [{ $invokes }]
247-
~~> make_impl_func! {
248-
type = [{ JitState<'j> }]
249-
lifetime = [{ 'j }]
231+
~~> make_func! {
250232
func = [{ $entry }]
251233
body = [{ self.$invokes( jit_code_t::$enum, std::ptr::null_mut() $(, $outarg )* ) }]
252234
rettype = [{ JitNode<'j> }]
@@ -264,9 +246,7 @@ macro_rules! jit_entry {
264246
tt_call! {
265247
macro = [{ jit_signature }]
266248
suffix = [{ $invokes }]
267-
~~> make_impl_func! {
268-
type = [{ JitState<'j> }]
269-
lifetime = [{ 'j }]
249+
~~> make_func! {
270250
func = [{ $entry }]
271251
body = [{ self.$invokes( jit_code_t::$enum $( ,$outarg )* ) }]
272252
rettype = [{ JitNode<'j> }]
@@ -278,7 +258,11 @@ macro_rules! jit_entry {
278258
}
279259

280260
macro_rules! jit_entries {
281-
( $( $tokens:tt )* ) => { $( $tokens )* };
261+
( $( $tokens:tt )* ) => {
262+
impl<'j> JitState<'j> {
263+
$( $tokens )*
264+
}
265+
};
282266
}
283267

284268
include!(concat!(env!("OUT_DIR"), "/entries.rs"));

0 commit comments

Comments
 (0)