GuillaumeGomez / rustc-tools

Some internal rustc tools made accessible
https://guillaumegomez.github.io/rustc-tools/
MIT License
41 stars 5 forks source link

Failed to to lint code that uses the `paste` macro #30

Closed nsarlin-zama closed 2 months ago

nsarlin-zama commented 2 months ago

First, thank you for this really useful package !

It seems that calling a tool on a crate that uses the paste macro fails because of a failed import:

   |
8  |           paste::paste! {
   |           ^^^^^ use of undeclared crate or module `paste`

However, the same code can be built with cargo build or linted cargo clippy. I have created a minimum reproducing example here: https://github.com/nsarlin-zama/test_lint_paste. Using the example tool on this crate returns the aforementioned error.

Thanks for your help

GuillaumeGomez commented 2 months ago

All done. I was not allowing proc-macro, so in this case it was not passed as dependency. I'm releasing 0.78.1 so you will be able to resume having fun with it. ;)

Thanks for the detailed issue!

nsarlin-zama commented 2 months ago

It works, thanks !