Skip to content

Commit 21bffc2

Browse files
committed
Moved type cast mention to introduction
1 parent 023b0db commit 21bffc2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/type-coercions.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
They happen automatically at specific locations and are highly restricted in
55
what types actually coerce.
66

7+
The [type cast operator], `as`, is not a coersion site. However, most type
8+
conversions allowed by coersion can also be explicitly performed by `as`.
9+
710
Coercions are originally defined in [RFC 401] and expanded upon in [RFC 1558].
811

12+
913
## Coercion sites
1014

1115
A coercion can only occur at certain coercion sites in a program; these are
@@ -65,10 +69,6 @@ sites are:
6569
}
6670
```
6771

68-
* The [as] type cast operator—while not a coercion site—can be used to
69-
explicitly perform type coercion.
70-
71-
7272
If the expression in one of these coercion sites is a coercion-propagating
7373
expression, then the relevant sub-expressions in that expression are also
7474
coercion sites. Propagation recurses from these new coercion sites.
@@ -190,6 +190,6 @@ unsized coercion to `Foo<U>`.
190190
[RFC 1558]: https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md
191191
[subtype]: subtyping.md
192192
[object safe]: items/traits.md#object-safety
193-
[as]: expressions/operator-expr.md#type-cast-expressions
193+
[type cast operator]: expressions/operator-expr.md#type-cast-expressions
194194
[`Unsize`]: ../std/marker/trait.Unsize.html
195195
[`CoerceUnsized`]: ../std/ops/trait.CoerceUnsized.html

0 commit comments

Comments
 (0)