Skip to content

Suggests to initialize struct with private fields, instead of looking for typo #39226

Closed

Description

@nagisa

I typo’d handle (local variable) with Handle (type with private fields I have no access to). Would have expected rustc to not emit such a note and maybe look for typos instead.

error[E0423]: expected value, found struct `Handle`
   |
73 |                     handle: Handle,
   |                             ^^^^^^ did you mean `Handle { /* fields */ }`?

Activity

  1. Freyskeyd commented on Jan 25, 2017

    @Freyskeyd
    Contributor

    I agree. I think it's better to look for context before looking for Struct or any other Expression.

    I will try to modify check order.

  2. added a commit that references this issue on Apr 29, 2017
  3. Freyskeyd commented on May 1, 2017

    @Freyskeyd
    Contributor

    This PR can be closed I think: refer to #39291

    cc @nagisa

  4. nagisa commented on May 2, 2017

    @nagisa
    MemberAuthor

    Great!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions