reference icon indicating copy to clipboard operation
reference copied to clipboard

Document `uniform_paths`

Open petrochenkov opened this issue 6 years ago • 3 comments

This is a documentation issue for https://github.com/rust-lang/rust/pull/56759

petrochenkov avatar Dec 27 '18 01:12 petrochenkov

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?

estebank avatar Apr 23 '20 19:04 estebank

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.

ehuss avatar Apr 23 '20 19:04 ehuss

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

bstrie avatar Apr 25 '21 17:04 bstrie