| 
15 | 15 | /// ```  | 
16 | 16 | ///  | 
17 | 17 | /// In general, any cast that can be performed via ascribing the type can also be done using `as`,  | 
18 |  | -/// so instead of writing `let x: u32 = 123`, you can write `let x = 123 as u32` (Note: `let x: u32  | 
19 |  | -/// = 123` would be best in that situation). The same is not true in the other direction, however,  | 
 | 18 | +/// so instead of writing `let x: u32 = 123`, you can write `let x = 123 as u32` (note: `let x: u32  | 
 | 19 | +/// = 123` would be best in that situation). The same is not true in the other direction, however;  | 
20 | 20 | /// explicitly using `as` allows a few more coercions that aren't allowed implicitly, such as  | 
21 | 21 | /// changing the type of a raw pointer or turning closures into raw pointers.  | 
22 | 22 | ///  | 
23 |  | -/// Other places `as` is used include as extra syntax for [`crate`] and `use`, to change the name  | 
24 |  | -/// something is imported as.  | 
 | 23 | +/// `as` is also used to rename imports in [`use`] and [`extern crate`] statements:  | 
25 | 24 | ///  | 
26 |  | -/// For more information on what `as` is capable of, see the [Reference]  | 
 | 25 | +/// ```  | 
 | 26 | +/// # #[allow(unused_imports)]  | 
 | 27 | +/// use std::{mem as memory, net as network};  | 
 | 28 | +/// // Now you can use the names `memory` and `network` to refer to `std::mem` and `std::net`.  | 
 | 29 | +/// ```  | 
 | 30 | +///  | 
 | 31 | +/// For more information on what `as` is capable of, see the [Reference].  | 
27 | 32 | ///  | 
28 | 33 | /// [Reference]: ../reference/expressions/operator-expr.html#type-cast-expressions  | 
29 |  | -/// [`crate`]: keyword.crate.html  | 
 | 34 | +/// [`use`]: keyword.use.html  | 
 | 35 | +/// [`extern crate`]: keyword.crate.html  | 
30 | 36 | mod as_keyword {}  | 
31 | 37 | 
 
  | 
32 | 38 | #[doc(keyword = "break")]  | 
@@ -397,6 +403,7 @@ mod enum_keyword {}  | 
397 | 403 | /// [Rust book]:  | 
398 | 404 | /// ../book/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code  | 
399 | 405 | /// [Reference]: ../reference/items/external-blocks.html  | 
 | 406 | +/// [`crate`]: keyword.crate.html  | 
400 | 407 | mod extern_keyword {}  | 
401 | 408 | 
 
  | 
402 | 409 | #[doc(keyword = "false")]  | 
 | 
0 commit comments