Fix code suggestion for local enum patterns in non-exhaustive matches by makai410 · Pull Request #137783 · rust-lang/rust (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh perhaps I got what you were worrying about, cc #137845.
It seems that they try to suggest a trimmed paths name in code only requiring that the name is unique, even if the things are in a different module.
Once users apply these code suggestions, then just let the compiler emit the suggestions like "use xxx;" to take users to the right way, which may be the idea of the design (btw it's just my guess, i ain't investigated it for now).

So here the problem is that the path is totally wrong because it is a function name which should not appear.

Idk if I got to the right way but I appreciate it if you're willing to point my problems out.