Skip to content

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

Closed
@sgrif

Description

@sgrif
Contributor

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

Activity

added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
A-diagnosticsArea: Messages for errors, warnings, and lints
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Jun 29, 2018
estebank

estebank commented on May 23, 2019

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

added
D-papercutDiagnostics: An error or lint that needs small tweaks.
on Jan 8, 2020
added a commit that references this issue on Jan 9, 2020

Rollup merge of rust-lang#68014 - estebank:unify-e0599, r=cramertj

12df732
added a commit that references this issue on Jan 10, 2020

Rollup merge of rust-lang#68014 - estebank:unify-e0599, r=cramertj

a491100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @sgrif@estebank@XAMPPRocky

      Issue actions

        E0223 should not be given in contexts where `::Thing` cannot be an associated type · Issue #49566 · rust-lang/rust