Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A proc macro would still need to be invoked as either

    cpp_call! { fn foo() { ... } }
or

   #[cpp_call] fn foo() { ... }
The former can be written even with a macro_rules macro. Regardless, both macros have to work by parsing the whole input tokentree `fn foo ( ) { ... }` and emitting it back with an `unsafe` prepended. The macro invocation cannot expand to just `unsafe`.


Yes, this is what I was meaning, thank you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: