3 The tracking issue for this feature is: [#44660]
5 [#44660]: https://github.com/rust-lang/rust/issues/44660
7 ------------------------
9 The `crate_in_paths` feature allows to explicitly refer to the crate root in absolute paths
10 using keyword `crate`.
12 This feature is required in `feature(extern_absolute_paths)` mode to refer to any absolute path
13 in the local crate (absolute paths refer to extern crates by default in that mode), but can be
14 used without `feature(extern_absolute_paths)` as well.
17 #![feature(crate_in_paths)]
19 // Imports, `::` is added implicitly
24 pub fn f() -> u8 { 1 }
25 pub fn g() -> u8 { 2 }
26 pub fn h() -> u8 { 3 }
28 // OK, visibilities implicitly add starting `::` as well, like imports
29 pub(in crate::m) struct S;
38 assert_eq!(crate::m::g(), 2);
39 assert_eq!(root::m::h(), 3);
45 assert_eq!(crate::m::g(), 2);
46 assert_eq!(root::m::h(), 3);