-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Change const error message to use 'literal' #46341
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
Conversation
The verbiage for E0015 (calls in constants are limited to...) gives "struct and enum constructors" as a suggestion. The word "constructor," while a good descriptor for a particular concept in Rust, also describes a special class of user-defined functions in other languages. This commit uses the word "literal" in place of the word "constructor."
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This error is reported for calls specifically, e.g. syntax If we want to avoid the word "constructor" then we can say
or
|
@petrochenkov, I'm not sure I understand. Are you saying that |
This. I mean, maybe there's a chance that you didn't actually want to call anything, but that's guessing. Maybe an extra suggestion attached to the primary error mentioning |
r? @estebank |
That seems to me to be the clearest option, although I'm probably not the best to make that judgment. :) |
@archer884 I would go with @petrochenkov's suggestion. Also, I'm surprised that there isn't an existing test for this output that caught your change. Could you add one? |
Honestly, all this other stuff is just beyond what I have knowledge/time for. |
@archer884 sad to hear that. If you ever get the time and wish to contribute again and get familiar with the codebase/rust, we have issues with mentoring instructions for the impl period. Also, feel free to reach out in gitter and IRC for help. |
The verbiage for E0015 ("calls in constants are limited to...") gives "struct and enum constructors" as a suggestion. The word "constructor," while a good descriptor for a particular concept in Rust, also describes a special class of user-defined functions in other languages. This commit substitutes the word "literal" in place of the word "constructor" in an effort to allay potential confusion.
Related issue here.