Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust analyzer macro expansion errors #99

Open
davidcole1340 opened this issue Oct 5, 2021 · 0 comments
Open

Rust analyzer macro expansion errors #99

davidcole1340 opened this issue Oct 5, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@davidcole1340
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant