gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Improve error [E0164] handling

Open beelchester opened this issue 1 year ago • 3 comments

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].

beelchester avatar Feb 25 '24 13:02 beelchester

@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].

beelchester avatar Mar 11 '24 20:03 beelchester

@sahilyeole you just need to rebase this on the latest master and we can merge it :)

CohenArthur avatar Mar 21 '24 14:03 CohenArthur

@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

CohenArthur avatar May 10 '24 15:05 CohenArthur