Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Better name for QPath #66

Open
matklad opened this issue Sep 16, 2019 · 4 comments
Open

Better name for QPath #66

matklad opened this issue Sep 16, 2019 · 4 comments

Comments

@matklad
Copy link
Member

matklad commented Sep 16, 2019

Reverse-turbofish paths like <_>::default are currently known as qualified paths, or QPaths. I've always found this terminology pretty confusing, because a type doesn't seem like a more qualifierer qualifier than crate:: or super::. I wonder if there's a better name for this production... Or are other folks happy with this naming?

@eddyb
Copy link
Member

eddyb commented Sep 16, 2019

They're called type-qualified paths, the turbofish name is entirely unofficial.
And yes, a type is far more significant than just a path keyword.

The type isn't a namespace in a type-qualified path, it's the type to search for an associated item on. And such a path is resolved during/after type inference, as opposed to during name resolution.

@matklad
Copy link
Member Author

matklad commented Sep 16, 2019

Yeah, the important word in “type qualified path” is the type, but QPath picks the less important :(

@Centril
Copy link
Contributor

Centril commented Sep 16, 2019

Call it TQPath ?

@eddyb
Copy link
Member

eddyb commented Sep 16, 2019

QPath is from rustc and it's a shorthand for MaybeQualifiedPath.
I guess in the grammar we could expand it out.

There's also "fully-qualified" or "trait-qualified" paths (<T as Trait>::...) which are also QPath.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants