-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Trying to capture a local variable in a const results in an unrelated error #51375
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
Comments
I tried to use different stable compilers to see, if there's an regression. Long long time ago, in the dark ages of 2016, there was a good error message. the good
the bad
the ugly
|
|
|
This is not a regression. This error message is old as dirt. That said, I've always found it confusing. I think we should brainstorm an improved message for this case (where a nested item captures something from an outer item). |
I would suggest a note
or maybe something like
|
cc @estebank |
|
I don't see, why this is an improvement to the old error message, especially to the explanation E0435 (see my comment). |
I believe the current output is good enough:
|
results in:
(which of course doesn't work — actually carrying out the suggestion results in the same suggestion).
The text was updated successfully, but these errors were encountered: