Open joshtriplett opened 2 years ago
Given a macro which processes extern C functions:
macro_rules! some_macro { (extern "C" { $($i:item)* }) => ( extern "C" { $($i)* }); }
And code invoking it:
some_macro! { extern "C" { pub fn func(arg: c_int) -> c_int; } }
systest will fail to parse this, emitting an error like this:
error: expected one of `!`, `(`, `::`, `<`, `where`, or `{`, found `;` --> ../src/lib.rs:120:82 | 118 | / some_macro! { 119 | | extern "C" { 120 | | pub fn func(arg: c_int) -> c_int; | | ^ expected one of `!`, `(`, `::`, `<`, `where`, or `{` here
If I modify the macro and invocation to go inside the extern "C" block rather than outside it, I instead get an internal compiler error:
extern "C"
error: internal compiler error: Error constructed but not emitted thread 'main' panicked at 'explicit panic', /path/to/.cargo/registry/src/github.com-1ecc6299db9ec823/garando_errors-0.1.0/src/diagnostic_builder.rs:190:13
I think this has the same root cause as #6, i.e. our parsing libraries are too old. We have to migrate to a newer crate (e.g. syn?) but it'd be hard work and I cannot promise I will work on it soon.
Given a macro which processes extern C functions:
And code invoking it:
systest will fail to parse this, emitting an error like this:
If I modify the macro and invocation to go inside the
extern "C"
block rather than outside it, I instead get an internal compiler error: