Skip to content

Commit 206af38

Browse files
committed
Auto merge of #29105 - billpmurphy:master, r=alexcrichton
Change the spacing/order of lines in the final pointer conversion example to make it more clear. Very small change, can be rolled up.
2 parents 971856d + 348cbe0 commit 206af38

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/doc/trpl/raw-pointers.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,15 @@ these properties are true for any references, no matter how they are created,
9898
and so any conversion from raw pointers is asserting that they hold. The
9999
programmer *must* guarantee this.
100100

101-
The recommended method for the conversion is
101+
The recommended method for the conversion is:
102102

103103
```rust
104-
let i: u32 = 1;
105-
106104
// explicit cast
105+
let i: u32 = 1;
107106
let p_imm: *const u32 = &i as *const u32;
108-
let mut m: u32 = 2;
109107

110108
// implicit coercion
109+
let mut m: u32 = 2;
111110
let p_mut: *mut u32 = &mut m;
112111

113112
unsafe {

0 commit comments

Comments
 (0)