diff options
| author | bors <bors@rust-lang.org> | 2015-10-17 17:53:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-17 17:53:53 +0000 |
| commit | 206af38e74ce7fa4b0e781ece7f1067c018c580e (patch) | |
| tree | e3dd5c13b15aa00e4f69f6989474d56f0967ceff | |
| parent | 971856d0ecc8a37fa06bad2738a992c0e6c459a0 (diff) | |
| parent | 348cbe0cb9d377dd4f20728b2daef796510887d7 (diff) | |
| download | rust-206af38e74ce7fa4b0e781ece7f1067c018c580e.tar.gz rust-206af38e74ce7fa4b0e781ece7f1067c018c580e.zip | |
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.
| -rw-r--r-- | src/doc/trpl/raw-pointers.md | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/doc/trpl/raw-pointers.md b/src/doc/trpl/raw-pointers.md index 8a3b98b7292..679f5489ea8 100644 --- a/src/doc/trpl/raw-pointers.md +++ b/src/doc/trpl/raw-pointers.md @@ -98,16 +98,15 @@ these properties are true for any references, no matter how they are created, and so any conversion from raw pointers is asserting that they hold. The programmer *must* guarantee this. -The recommended method for the conversion is +The recommended method for the conversion is: ```rust -let i: u32 = 1; - // explicit cast +let i: u32 = 1; let p_imm: *const u32 = &i as *const u32; -let mut m: u32 = 2; // implicit coercion +let mut m: u32 = 2; let p_mut: *mut u32 = &mut m; unsafe { |
