Confusing error when defining constant #46336
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
WG-diagnostics
Working group: Diagnostics
The following error results when attempting to create a constant from some non-constant function:
This may confuse rustaceans coming from languages where "constructors" are specially defined functions, since, in this case, it refers to
Foo { field: Expression }
rather than, say,Foo::new()
.Better phrasing may be
struct and enum literals
?The text was updated successfully, but these errors were encountered: