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

Document current limitation of type aliases on enums #984

Closed
wants to merge 2 commits into from

Conversation

bstrie
Copy link
Contributor

@bstrie bstrie commented Mar 18, 2021

Question: is the intent of the reference to document how the language currently is, or how it should be? Because the behavior documented in this PR is something that I would like to be changed in the future (rust-lang/rust#83248), but in the meantime it might be useful to readers to better understand the limitations of type aliases as they are currently implemented.

src/items/type-aliases.md Outdated Show resolved Hide resolved
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
@petrochenkov
Copy link
Contributor

This is not a separate rule though, just an example of type-relative resolution not being supported in imports due to compiler staging.

@bstrie
Copy link
Contributor Author

bstrie commented Mar 18, 2021

@petrochenkov It would still be useful to mention that rule somewhere on this page. Is there a better way to word it, or some canonical part of the reference to link to?

@Havvy
Copy link
Contributor

Havvy commented Mar 19, 2021

I looked around in different places for the general rule, but I don't see it documented anywhere. I'm also not sure how to formulate the general rule, so I don't know where it would go either.

@ehuss
Copy link
Contributor

ehuss commented Mar 22, 2021

I think this boils down to documenting uniform paths (#487). I thought there was something already in the reference about multi-segment paths and the requirements of the non-terminal segments, but I can't find anything.

I think this would end up being part of (possibly significant) changes to the "Paths" chapter, the overhaul of the "Use declarations" chapter, and writing the "Resolution" chapter which could help clarify how paths are handled.

I have been slowly making progress in the background on name resolution, which ties into all of this.

@bstrie
Copy link
Contributor Author

bstrie commented Apr 2, 2021

Shall I close this in favor of your future additions, then?

@Havvy
Copy link
Contributor

Havvy commented Apr 7, 2021

FWIW, having it now would be better than waiting for the indeterminate future since it can always be removed later. But I don't know @ehuss's progress, so I'll .await their answer to the question.

@bstrie
Copy link
Contributor Author

bstrie commented Apr 25, 2021

I'll close this for now; I've left a comment on #487 to help remember to document this specific case in the future.

@bstrie bstrie closed this Apr 25, 2021
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.

5 participants