Improve error [E0164] handling
This PR is an improvement over #2565. It checks for path segment size to ensure error [E0164] is correctly emitted in case of associated functions in a pattern.
Fixes #2846.
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
Use segment size to identify associated functions for [E0164].
@sahilyeole could you add a testcase for this? to ensure we don't introduce regressions down the line. thanks :)
I'm not sure what testcase I can add since testcase for [E0164] was already added in #2565 and the code mentioned in #2846 now gives ICE (because it seems tuple struct patterns are not implemented yet), instead of [E0164].
@sahilyeole you just need to rebase this on the latest master and we can merge it :)
@sahilyeole the CI is failing because the API changed a little bit for the code you're using :) if you adapt it we can merge it