ext-php-rs
ext-php-rs copied to clipboard
Rust analyzer macro expansion errors
With this change in rust-analyzer, expansion of ext-php-rs macros errors out as they are no longer expanded in order. This is because Rust provides no guarantees of macro expansion, and the library abuses the fact that rustc expands them (at the moment) in order by maintaining a global proc-macro state.
Currently the solution to this is to disable macro expansion in rust-analyzer:
"rust-analyzer.experimental.procAttrMacros": false
It could be best to move to remove this global state. The global state is used to maintain a register of all the entities to be registered in the PHP module startup and get module functions.