Skip to content

Commit 10b4eaf

Browse files
committed
---
yaml --- r: 228984 b: refs/heads/try c: 108a697 h: refs/heads/master v: v3
1 parent 16e0a69 commit 10b4eaf

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: b26958caf745a05b4fa45b655ffeab18445cdb9b
4+
refs/heads/try: 108a697b1c225dafef16a77076e30149b1d0ebe7
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/conversions.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Coercion is allowed between the following types:
5353
* `&mut T` to `*mut T`
5454
* Unsizing: `T` to `U` if `T` implements `CoerceUnsized<U>`
5555

56-
`CoerceUnsized<Pointer<U>> for Pointer<T>` where T: Unsize<U> is implemented
56+
`CoerceUnsized<Pointer<U>> for Pointer<T> where T: Unsize<U>` is implemented
5757
for all pointer types (including smart pointers like Box and Rc). Unsize is
5858
only implemented automatically, and enables the following transformations:
5959

@@ -65,7 +65,6 @@ only implemented automatically, and enables the following transformations:
6565
* `Foo` is a struct
6666
* Only the last field has type `T`
6767
* `T` is not part of the type of any other fields
68-
(note that this also applies to to tuples as an anonymous struct `Tuple3<T, U, V>`)
6968

7069
Coercions occur at a *coercion site*. Any location that is explicitly typed
7170
will cause a coercion to its type. If inference is necessary, the coercion will
@@ -106,13 +105,19 @@ fn main() {
106105
^~~
107106
```
108107

108+
109+
110+
109111
# The Dot Operator
110112

111113
The dot operator will perform a lot of magic to convert types. It will perform
112114
auto-referencing, auto-dereferencing, and coercion until types match.
113115

114116
TODO: steal information from http://stackoverflow.com/questions/28519997/what-are-rusts-exact-auto-dereferencing-rules/28552082#28552082
115117

118+
119+
120+
116121
# Casts
117122

118123
Casts are a superset of coercions: every coercion can be explicitly invoked via a
@@ -171,6 +176,8 @@ For numeric casts, there are quite a few cases to consider:
171176

172177

173178

179+
180+
174181
# Conversion Traits
175182

176183
TODO?

0 commit comments

Comments
 (0)