Skip to content

Commit 4382968

Browse files
committed
Assignment coercion site
1 parent 5b3ca00 commit 4382968

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/type-coercions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ r[coerce.site.return]
7878
}
7979
```
8080

81+
r[coerce.site.assignment]
82+
* Assigned value operands in assignment expressions
83+
84+
For example, `y` is coerced to have type `&i8` in the following:
85+
```rust
86+
let mut x = &0i8;
87+
let y = &mut 42i8;
88+
x = y;
89+
```
90+
8191
r[coerce.site.subexpr]
8292
If the expression in one of these coercion sites is a coercion-propagating
8393
expression, then the relevant sub-expressions in that expression are also

0 commit comments

Comments
 (0)