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

E0223 should not be given in contexts where ::Thing cannot be an associated type #49566

Closed
sgrif opened this issue Apr 1, 2018 · 1 comment · Fixed by #68014
Closed

E0223 should not be given in contexts where ::Thing cannot be an associated type #49566

sgrif opened this issue Apr 1, 2018 · 1 comment · Fixed by #68014
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sgrif
Copy link
Contributor

sgrif commented Apr 1, 2018

Specifically, when there is code in the form of SomeEnum::MissingVariant { field: () }, we should be receiving E0599, behaving the same as if we had written SomeEnum::MissingVariant(()).

Example to reproduce: https://play.rust-lang.org/?gist=5fd6bb1d589b9e27b7b9ba0cd8d6cb50&version=stable

@XAMPPRocky XAMPPRocky added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 29, 2018
@estebank
Copy link
Contributor

Current output:

error: no variant `Baz` in enum `Foo`
 --> src/main.rs:6:18
  |
1 | enum Foo {
  | -------- variant `Baz` not found here
...
6 |     let x = Foo::Baz { id: 1 };
  |                  ^^^ help: there is a variant with a similar name: `Bar`
error[E0599]: no variant or associated item named `Baz` found for type `Foo` in the current scope
 --> src/main.rs:6:18
  |
1 | enum Foo {
  | -------- variant or associated item `Baz` not found here
...
6 |     let x = Foo::Baz(());
  |                  ^^^
  |                  |
  |                  variant or associated item not found in `Foo`
  |                  help: there is a variant with a similar name: `Bar`
error[E0599]: no variant or associated item named `Baz` found for type `Foo` in the current scope
 --> src/main.rs:6:18
  |
1 | enum Foo {
  | -------- variant or associated item `Baz` not found here
...
6 |     let x = Foo::Baz;
  |                  ^^^
  |                  |
  |                  variant or associated item not found in `Foo`
  |                  help: there is a variant with a similar name: `Bar`

It is close enough, but it needs to be turned into a E0599 instead of a codeless error.

@estebank estebank added the D-papercut Diagnostics: An error or lint that needs small tweaks. label Jan 8, 2020
Centril added a commit to Centril/rust that referenced this issue Jan 9, 2020
@bors bors closed this as completed in a491100 Jan 10, 2020
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 C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants