Skip to content
Discussion options

You must be logged in to vote

It is intended for performance issues, as searching through all bodies would seriously regress the perf.

You could find multiple places we are collecting declarations/impls inside bodies only for anonymous consts:
https://github.com/search?q=repo%3Arust-lang%2Frust-analyzer%20unnamed_consts&type=code

Actually, rustc isn't so happy with those cases either so there is a clippy lint for it. You would see the lint for impl Test for the first two cases of your example code, but for the last case.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@ChayimFriedman2
Comment options

@ShoyuVanilla
Comment options

Answer selected by nicola-gigante
Comment options

You must be logged in to vote
1 reply
@nicola-gigante
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants