Document the usage scenario of "as" keyword for trait coercion #86287
Labels
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.
I've just stumbled about such an error:
an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
It seems that the second part of it is about syntax like this:
But these scenarios don't seem to be documented on the
as
page in the official docs:https://doc.rust-lang.org/std/keyword.as.html
It states that
as
can be used only to "cast between types, or rename an import".The text was updated successfully, but these errors were encountered: