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

Add support for the rename item #7

Merged
merged 7 commits into from
Nov 10, 2023
Merged

Conversation

pratapsingh1729
Copy link
Contributor

This PR adds support for the rename item, which allows use crate as _ (importing the crate without importing its name).

I added a small test.

Copy link
Collaborator

@jaybosamiya jaybosamiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Pratap, this looks good to me! Can you update (via rebase) the branch to make sure that the CI has run? It was added after you opened the PR, and thus wasn't triggered on your PR. Thanks!

@jaybosamiya jaybosamiya enabled auto-merge (squash) November 10, 2023 10:08
jaybosamiya and others added 4 commits November 10, 2023 15:41
As has been noticed before, things like `as` would end up causing
something like `assert` to be parsed as `as sert`, and thus needed
explicit workarounds like f7c22d7 (for
`as`, `is` and `has`), or 4a9d96c (for
`box`). #6 also is an issue of this kind (for `mut`). Basically, we were
fixing this issue as we hit it each time, in an ad-hoc way at the _use
site_ of the specific problematic prefix.

This PR fixes it once and for all, by making all the strings make sure
that they aren't a prefix of a longer string (by using a negative
lookahead), that way the use-sites don't need to worry about these
strings. Thus, this PR also cleans up the previous workarounds that were
added in the past.
@jaybosamiya jaybosamiya merged commit 73910ea into main Nov 10, 2023
2 checks passed
@jaybosamiya jaybosamiya deleted the pratap-support-rename-item branch November 10, 2023 16:31
@pratapsingh1729
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants