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

Create abstraction over paths for use in librustc_resolve #50258

Closed
Manishearth opened this issue Apr 26, 2018 · 3 comments
Closed

Create abstraction over paths for use in librustc_resolve #50258

Manishearth opened this issue Apr 26, 2018 · 3 comments
Labels
A-resolve Area: Path resolution C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Manishearth
Copy link
Member

Currently, librustc_resolve passes around paths as &[Ident].

Ideally, we'd have an abstraction over paths that:

  • contains this slice
  • contains a source node id for linting
  • contains a flag for whether or not the path is speculative -- sometimes we try to resolve paths not specified by the user to produce better error messages. We shouldn't be throwing errors for these.
  • eventually (out of scope for this change) -- contains a flag for whether or not the flag was originally a global path (::foo)

Currently the last two are kinda compressed into an Option<NodeId> argument to resolve_path -- when it's speculative, the Option is None.

Having a Path abstraction would be nice.

@Manishearth Manishearth added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-resolve Area: Path resolution labels Apr 26, 2018
@IsaacWoods
Copy link
Contributor

If nobody is working on this, I'd like to give it a go to get my feet wet (never contributed to rustc tho)?

@XAMPPRocky XAMPPRocky added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 2, 2018
@TheSirC
Copy link

TheSirC commented Dec 5, 2018

Is there anymore work to be done on that end ? @Aaronepower ? @IsaacWoods ? @Manishearth ?

@petrochenkov
Copy link
Contributor

I'll go ahead an close this as not-an-issue.
Interfaces in librustc_resolve generally need to be rethought into something more systematic, especially after they changed a lot recently to accommodate new features, but simply grouping parameters of resolve_path into a struct won't move things into the right direction, but mostly bring unnecessary churn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Path resolution C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants