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

Bunch of improvements on explaining `impl Trait` #1481

Closed
wants to merge 4 commits into from

Conversation

Projects
None yet
3 participants
@earthengine
Copy link

earthengine commented Aug 11, 2018

The section 10-2 especially the impl Trait part is incorrect or at least misleading.

This work is:

  • Being verbosely explained that impl Trait means anonymous type, because many people believe it is just syntax sugar in argument position, and existential in return position. This is misunderstanding of this feature.
  • Corrected misleading concepts behind desugaring (expecially, two impl Trait on the same trait means two different types)
  • Given better explaination for the single type restriction when use impl Trait in return position, with example codes of alternatives.
@carols10cents

This comment has been minimized.

Copy link
Member

carols10cents commented Dec 10, 2018

Hi, thank you for the PR! However, I think a lot of these are details that new Rust users don't need to know right away. The book is very much trying to give just what you need to know to be productive, and other resources like the Reference or the Nomicon or perhaps new resources are better places for the details you've added here. So thank you, but I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.