ext-php-rs icon indicating copy to clipboard operation
ext-php-rs copied to clipboard

Rust analyzer macro expansion errors

Open davidcole1340 opened this issue 4 years ago • 0 comments

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.

davidcole1340 avatar Oct 05 '21 07:10 davidcole1340