Using error
as variable name in a pattern
#4647
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
So, I just wasted an hour pulling my hair out about this. Minimal program:
rustc version: 09bb07b (master from a few weeks ago)
rustc output:
This error message is terrible. What’s going on here is that
error
is a constant from libcore.The message when using the name of a constant for a new variable is not much better:
Shouldn’t scoping take care of this? Variables should be able to "mask" constants as long as they’re in scope.
The text was updated successfully, but these errors were encountered: