File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
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
You can’t perform that action at this time.
0 commit comments