Skip to content

Rustc misunderstands when an @ is missing in a pattern and the error message is confusing #88404

Closed

Description

@Lokathor

playground

I should have typed rest @ .., and to fix my problem I need to add the @ between rest and ..

Instead rustc tries to tell me three different ways that "rest.." is wrong, none of which are "hey did you forget the @ sign?"

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    A-patternsRelating to patterns and pattern matching
    A-slice-patternsArea: Slice patterns, https://github.com/rust-lang/rust/issues/23121
    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`
    D-confusingDiagnostics: Confusing error or lint that should be reworked.
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Aug 28, 2021
  2. added a commit that references this issue on Nov 17, 2023
    5c3e01a
  3. added a commit that references this issue on Nov 17, 2023
    488c2aa
  4. added a commit that references this issue on Nov 17, 2023
    65f933b
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 lintsA-patternsRelating to patterns and pattern matchingA-slice-patternsArea: Slice patterns, https://github.com/rust-lang/rust/issues/23121A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.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

      No branches or pull requests

      Issue actions