Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reassign E0406 to be thrown when undeclared associated type appears in function signature. #34301

Closed
nikhilshagri opened this issue Jun 16, 2016 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@nikhilshagri
Copy link
Contributor

nikhilshagri commented Jun 16, 2016

Currently, when an undeclared associated type is used in a function signature within a trait body, like:

trait Foo {
    type Bar;
    //error: Baz is used but not declared
    fn return_bool(&self, &Self::Bar, &Self::Baz) -> bool;
}

it throws E0220, which isn't really helpful in this situation. Also, I found E0406 to be the more appropriate error here. This error is thrown for some feature which hasn't been implemented yet( and probably won't be), so it can be repurposed. See #34230 for more.
We could modify the error message for E0220 to include the above erroneous code, but I think it would be better to throw E0406 instead of E0220 in this situation.

/cc @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

I'll try to take a look.

@apasel422 apasel422 added the A-diagnostics Area: Messages for errors, warnings, and lints label Jun 17, 2016
@eddyb
Copy link
Member

eddyb commented Jun 18, 2016

E0406 is from some leftover code that shouldn't have existed in the first place.
E0220 is the correct error to use, message being:

error: associated type `Baz` not found for `Self``

The only problem I see is E0220's description needing to be updated. Also see #34342 (comment).

bors added a commit that referenced this issue Jun 18, 2016
Removed unused E0406 and unused functions

Fixes #34301.

It removes the unused E0406 and also unused functions.

cc @eddyb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

4 participants