Skip to content

Incorrect suggestion to add turbofish when > is missing #121901

Closed
@RalfJung

Description

@RalfJung

Code

type One = for<'b, 'a> fn(Box<dyn Send + 'a + 'b);

Current output

error: generic args in patterns require the turbofish syntax
 --> src/lib.rs:1:30
  |
1 | type One = for<'b, 'a> fn(Box<dyn Send + 'a + 'b);
  |                              ^
  |
help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
  |
1 | type One = for<'b, 'a> fn(Box::<dyn Send + 'a + 'b);
  |                              ++

Desired output

No response

Rationale and extra context

Adding the turbofish is wrong, so the output should be something else that doesn't ask me to add the turbofish.

Other cases

No response

Rust Version

1.76.0 (via Playground), unchanged on current nightly

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsD-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.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