File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 4
4
They happen automatically at specific locations and are highly restricted in
5
5
what types actually coerce.
6
6
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
+
7
10
Coercions are originally defined in [ RFC 401] and expanded upon in [ RFC 1558] .
8
11
12
+
9
13
## Coercion sites
10
14
11
15
A coercion can only occur at certain coercion sites in a program; these are
@@ -65,10 +69,6 @@ sites are:
65
69
}
66
70
```
67
71
68
- * The [ as] type cast operator&mdash ; while not a coercion site&mdash ; can be used to
69
- explicitly perform type coercion.
70
-
71
-
72
72
If the expression in one of these coercion sites is a coercion-propagating
73
73
expression, then the relevant sub-expressions in that expression are also
74
74
coercion sites. Propagation recurses from these new coercion sites.
@@ -190,6 +190,6 @@ unsized coercion to `Foo<U>`.
190
190
[ RFC 1558 ] : https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md
191
191
[ subtype ] : subtyping.md
192
192
[ 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
194
194
[ `Unsize` ] : ../std/marker/trait.Unsize.html
195
195
[ `CoerceUnsized` ] : ../std/ops/trait.CoerceUnsized.html
You can’t perform that action at this time.
0 commit comments