Description
error: illegal width
4for float literal, valid widths are 32 and 64
error: illegal recursive enum type; wrap the inner value in a box to make it representable [E0072]
You can almost always replace illegal
with invalid
. Since we're (probably) not breaking the law writing Rust code, we shouldn't use terms about breaking the law.
It seems like this language mostly comes from early specifications, and it causes problems. If panic reasons are visible to end users - users who don't understand it's not illegal under the penal code - they may think they've done something really bad. It's also probably not a good word to see for people for whom English is not their first language.
So please, let's get all the occurrences of "illegal" in error messages out of the language.