mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
Avoid invalid suggestion in case of macro expansion without inferrable generic type Closes rust-lang/rust#129756 . The main challenge for me in this PR was figuring out how to pass down the information of the code being generated from expansion. I went for the simplest approach I could think of, but I questioned myself if the boolean should be placed inside the Visitor. I don't have enough information to figure this out, if it's badly placed I'd be happy to fix and learn! About the test, I split the two commits because we can see the issue being reproduced in the first commit but being fixed on the second. I also added a non-expansion example of the same code to show it won't get altered. Oh, also I didn't know the best place to place the test. I went for the place with same kind of errors, but I guess `proc-macros` could also be a place.