File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -46,25 +46,25 @@ sites are:
4646 For example, ` &mut 42 ` is coerced to have type ` &i8 ` in the following:
4747
4848 ``` rust
49- struct Foo { x : & i8 }
49+ struct Foo <' a > { x : & ' a i8 }
5050
5151 fn main () {
5252 Foo { x : & mut 42 };
5353 }
5454 ```
5555
56- (Note that lifetime specifiers on ` struct Foo ` have been omitted for brevity.)
57-
5856* Function results&ndash ; either the final line of a block if it is not
5957 semicolon-terminated or any expression in a ` return ` statement
6058
6159 For example, ` x ` is coerced to have type ` &dyn Display ` in the following:
6260
6361 ``` rust
62+ use std :: fmt :: Display ;
6463 fn foo (x : & u32 ) -> & dyn Display {
6564 x
6665 }
6766 ```
67+
6868* The [ as] type cast operator can also explicitly perform type coersion.
6969
7070
@@ -187,7 +187,7 @@ unsized coercion to `Foo<U>`.
187187
188188[ RFC 401 ] : https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
189189[ RFC 1558 ] : https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md
190- [ subtype ] : subtyping.html`
191- [ as ] : operator-expr.html #type-cast-expressions`
190+ [ subtype ] : subtyping.md
191+ [ as ] : expressions/ operator-expr.md #type-cast-expressions
192192[ `Unsize` ] : ../std/marker/trait.Unsize.html
193193[ `CoerceUnsized` ] : ../std/ops/trait.CoerceUnsized.html
You can’t perform that action at this time.
0 commit comments