Skip to content

Commit 3c5550a

Browse files
committed
Tweaked some phrasing for clarity
1 parent f44e685 commit 3c5550a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/type-coercions.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Type coercions
22

3-
**Type coercions** are implicit changes of the type of a value. They happen
4-
automatically at specific locations and are highly restricted in what types
5-
actually coerce.
3+
**Type coercions** are implicit operations that change the type of a value.
4+
They happen automatically at specific locations and are highly restricted in
5+
what types actually coerce.
66

77
Coercions are originally defined in [RFC 401] and expanded upon in [RFC 1558].
88

@@ -21,7 +21,7 @@ sites are:
2121
let _: &i8 = &mut 42;
2222
```
2323

24-
* `static` and `const` items (similar to `let` statements).
24+
* `static` and `const` item declarations (similar to `let` statements).
2525

2626
* Arguments for function calls
2727

@@ -52,19 +52,20 @@ sites are:
5252
Foo { x: &mut 42 };
5353
}
5454
```
55+
56+
(Note that lifetime specifiers on `struct Foo` have been omitted for brevity.)
5557

5658
* Function results–either the final line of a block if it is not
5759
semicolon-terminated or any expression in a `return` statement
5860

59-
For example, `x` is coerced to have type `&dyn Binary` in the following:
61+
For example, `x` is coerced to have type `&dyn Display` in the following:
6062

6163
```rust
62-
fn foo(x: &u32) -> &dyn Binary {
64+
fn foo(x: &u32) -> &dyn Display {
6365
x
6466
}
6567
```
66-
The [as] keyword can also be used to perform explicit type coersion, as well as
67-
some additional casts.
68+
* The [as] type cast operator can also explicitly perform type coersion.
6869

6970

7071
If the expression in one of these coercion sites is a coercion-propagating

0 commit comments

Comments
 (0)