Skip to content

Suggest turbofish for uninferred const arguments #76737

Closed
@varkor

Description

@varkor

At the moment, we simply emit errors like:

error[E0282]: type annotations needed
  --> $DIR/method-chain.rs:21:33
   |
LL |     Foo.bar().bar().bar().bar().baz();
   |                                 ^^^
   |
   = note: cannot infer the value of the const parameter `N`

It would be good to suggest to the user how to fix this, like with uninferred type arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.F-const_generics`#![feature(const_generics)]`const-generics-bad-diagnosticsAn error is correctly emitted, but is confusing, for `min_const_generics`.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions