Skip to content

Commit

Permalink
Fixed code to pass ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AloeareV committed Jun 30, 2020
1 parent 8983dcc commit 79e0589
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/type-coercions.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ sites are:
For example, `&mut 42` is coerced to have type `&i8` in the following:

```rust
struct Foo { x: &i8 }
struct Foo<'a> { x: &'a i8 }

fn main() {
Foo { x: &mut 42 };
}
```

(Note that lifetime specifiers on `struct Foo` have been omitted for brevity.)

* Function results&ndash;either the final line of a block if it is not
semicolon-terminated or any expression in a `return` statement

For example, `x` is coerced to have type `&dyn Display` in the following:

```rust
use std::fmt::Display;
fn foo(x: &u32) -> &dyn Display {
x
}
```

* The [as] type cast operator can also explicitly perform type coersion.


Expand Down Expand Up @@ -187,7 +187,7 @@ unsized coercion to `Foo<U>`.
[RFC 401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
[RFC 1558]: https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md
[subtype]: subtyping.html`
[as]: operator-expr.html#type-cast-expressions`
[subtype]: subtyping.md
[as]: expressions/operator-expr.md#type-cast-expressions
[`Unsize`]: ../std/marker/trait.Unsize.html
[`CoerceUnsized`]: ../std/ops/trait.CoerceUnsized.html

0 comments on commit 79e0589

Please sign in to comment.