Skip to content

Commit 3f8e029

Browse files
committed
remove subtyping from coercions, it's something else
1 parent 5f02de3 commit 3f8e029

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/doc/tarpl/coercions.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
% Coercions
22

33
Types can implicitly be coerced to change in certain contexts. These changes are
4-
generally just *weakening* of types, largely focused around pointers and lifetimes.
5-
They mostly exist to make Rust "just work" in more cases, and are largely harmless.
4+
generally just *weakening* of types, largely focused around pointers and
5+
lifetimes. They mostly exist to make Rust "just work" in more cases, and are
6+
largely harmless.
67

78
Here's all the kinds of coercion:
89

9-
1010
Coercion is allowed between the following types:
1111

12-
* Subtyping: `T` to `U` if `T` is a [subtype][] of `U`
13-
* Transitivity: `T_1` to `T_3` where `T_1` coerces to `T_2` and `T_2` coerces to `T_3`
12+
* Transitivity: `T_1` to `T_3` where `T_1` coerces to `T_2` and `T_2` coerces to
13+
`T_3`
1414
* Pointer Weakening:
1515
* `&mut T` to `&T`
1616
* `*mut T` to `*const T`
@@ -68,5 +68,3 @@ fn main() {
6868
<anon>:10 foo(t);
6969
^~~
7070
```
71-
72-
[subtype]: subtyping.html

0 commit comments

Comments
 (0)