Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for advice for a way forward for resolving Self and self #125

Closed

Conversation

dillonhicks
Copy link
Contributor

This isn't rebased on the current changes that support "path tree" and is I have crate and super working reliably but Self and self are problematic.

So I need help tracking down these two problems:

@udoprog
Copy link
Collaborator

udoprog commented Sep 29, 2020

Resolving self fails if not prefixed with :: because it is parsed as a Expr::Self_. Should I just remove this in favor of parsing "paths"?

Yeah. Definitely.

Resolving Self works in the simplest cases but fails in nested impl contexts, see: [..]

It should be possible to resolve Self from impl_items for now:

pub(crate) impl_items: Vec<Item>,

You'll have to store this in Query and look it up through an opaque identifier. Similar to how it's done to figure out where a path is resolved from today:

path.id = self.query.insert_item(self.items.item());

It follows that of Self is encountered outside of an impl block it should cause an error.

@udoprog udoprog added question enhancement New feature or request labels Sep 29, 2020
@dillonhicks
Copy link
Contributor Author

I rebased onto 8a43abb. I'm going to give this one last attempt before I admit defeat.

I am going to focus on Self and ignore self at the moment since that might be a bit of a distraction because of the parsing changes.

Thanks!

@udoprog udoprog added the changelog Issue has been added to the changelog label Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue has been added to the changelog enhancement New feature or request question
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants