reference
reference copied to clipboard
Document `uniform_paths`
This is a documentation issue for https://github.com/rust-lang/rust/pull/56759
Some information around 2018 edition has been added to https://github.com/rust-lang/reference/blob/master/src/items/use-declarations.md. Is the current state of the documentation enough to close this ticket @petrochenkov?
We just undocumented it (#665), because it was wrong in several ways. There is an open PR #697 to update it, but I think the PR is still incomplete, and doesn't really address the underlying issue. Personally, I don't think it can be properly documented without documenting all of name resolution, which is a huge project.
One subtask of this is to document the limitations of type aliases WRT associated items (including enum variants, which are secretly associated items):
mod my_mod {
pub enum MyEnum {
MyVariant
}
pub type TypeAlias = MyEnum;
}
use my_mod::MyEnum; // OK
use my_mod::MyEnum::MyVariant; // OK
use my_mod::TypeAlias; // OK
use my_mod::TypeAlias::MyVariant; // Doesn't work
let _ = my_mod::TypeAlias::MyVariant; // OK