@@ -17,12 +17,12 @@ function result.
1717The most common case of coercion is removing mutability from a reference:
1818
1919 * ` &mut T ` to ` &T `
20-
20+
2121An analogous conversion is to remove mutability from a
2222[ raw pointer] ( raw-pointers.md ) :
2323
2424 * ` *mut T ` to ` *const T `
25-
25+
2626References can also be coerced to raw pointers:
2727
2828 * ` &T ` to ` *const T `
@@ -32,7 +32,7 @@ References can also be coerced to raw pointers:
3232Custom coercions may be defined using [ ` Deref ` ] ( deref-coercions.md ) .
3333
3434Coercion is transitive.
35-
35+
3636# ` as `
3737
3838The ` as ` keyword does safe casting:
@@ -64,7 +64,7 @@ A cast `e as U` is also valid in any of the following cases:
6464 and ` U ` is an integer type; * enum-cast*
6565 * ` e ` has type ` bool ` or ` char ` and ` U ` is an integer type; * prim-int-cast*
6666 * ` e ` has type ` u8 ` and ` U ` is ` char ` ; * u8-char-cast*
67-
67+
6868For example
6969
7070``` rust
@@ -98,9 +98,9 @@ The semantics of numeric casts are:
9898
9999[ float-int ] : https://github.com/rust-lang/rust/issues/10184
100100[ float-float ] : https://github.com/rust-lang/rust/issues/15536
101-
101+
102102## Pointer casts
103-
103+
104104Perhaps surprisingly, it is safe to cast [ raw pointers] ( raw-pointers.md ) to and
105105from integers, and to cast between pointers to different types subject to
106106some constraints. It is only unsafe to dereference the pointer:
@@ -114,7 +114,7 @@ let b = a as u32;
114114
115115* ` e ` has type ` *T ` , ` U ` has type ` *U_0 ` , and either ` U_0: Sized ` or
116116 ` unsize_kind(T) == unsize_kind(U_0) ` ; a * ptr-ptr-cast*
117-
117+
118118* ` e ` has type ` *T ` and ` U ` is a numeric type, while ` T: Sized ` ; * ptr-addr-cast*
119119
120120* ` e ` is an integer and ` U ` is ` *U_0 ` , while ` U_0: Sized ` ; * addr-ptr-cast*
0 commit comments