1 # `extern_absolute_paths`
3 The tracking issue for this feature is: [#44660]
5 [#44660]: https://github.com/rust-lang/rust/issues/44660
7 ------------------------
9 The `extern_absolute_paths` feature enables mode allowing to refer to names from other crates
10 "inline", without introducing `extern crate` items, using absolute paths like `::my_crate::a::b`.
12 `::my_crate::a::b` will resolve to path `a::b` in crate `my_crate`.
14 `feature(crate_in_paths)` can be used in `feature(extern_absolute_paths)` mode for referring
15 to absolute paths in the local crate (`crate::a::b`).
17 `feature(extern_in_paths)` provides the same effect by using keyword `extern` to refer to
18 paths from other crates (`extern::my_crate::a::b`).
21 #![feature(extern_absolute_paths)]
23 // Suppose we have a dependency crate `xcrate` available through `Cargo.toml`, or `--extern`
24 // options, or standard Rust distribution, or some other means.
32 assert_eq!(format!("{:?}", s), "S");
34 assert_eq!(format!("{:?}", z), "Z");
39 assert_eq!(format!("{:?}", s), "S");
41 assert_eq!(format!("{:?}", z), "Z");