Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest turbofish for uninferred const arguments #76737

Closed
varkor opened this issue Sep 15, 2020 · 2 comments · Fixed by #77758
Closed

Suggest turbofish for uninferred const arguments #76737

varkor opened this issue Sep 15, 2020 · 2 comments · Fixed by #77758
Labels
A-const-generics Area: const generics (parameters and arguments) A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` const-generics-bad-diagnostics An error is correctly emitted, but is confusing, for `min_const_generics`. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. F-const_generics `#![feature(const_generics)]`

Comments

@varkor
Copy link
Member

varkor commented Sep 15, 2020

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.

@varkor varkor added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. const-generics-blocking const-generics-bad-diagnostics An error is correctly emitted, but is confusing, for `min_const_generics`. labels Sep 15, 2020
@varkor

This comment has been minimized.

RalfJung added a commit to RalfJung/rust that referenced this issue Sep 26, 2020
…r=varkor

merge `need_type_info_err(_const)`

I hoped that this would automatically solve rust-lang#76737 but it doesn't quite seem like it

fixes rust-lang#77092

r? @varkor
RalfJung added a commit to RalfJung/rust that referenced this issue Sep 26, 2020
…r=varkor

merge `need_type_info_err(_const)`

I hoped that this would automatically solve rust-lang#76737 but it doesn't quite seem like it

fixes rust-lang#77092

r? @varkor
@varkor
Copy link
Member Author

varkor commented Oct 9, 2020

Stu over on Zulip has picked this issue up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` const-generics-bad-diagnostics An error is correctly emitted, but is confusing, for `min_const_generics`. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. F-const_generics `#![feature(const_generics)]`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant