Update section on "existential type" to "opaque type"#402
Merged
mark-i-m merged 1 commit intorust-lang:masterfrom Aug 29, 2019
Merged
Update section on "existential type" to "opaque type"#402mark-i-m merged 1 commit intorust-lang:masterfrom
mark-i-m merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
Arnavion
reviewed
Aug 5, 2019
Contributor
|
Ping @varkor there are some comments waiting for you |
aa21edd to
5822f48
Compare
Contributor
Author
|
Addressed the comments. |
spastorino
approved these changes
Aug 28, 2019
Contributor
|
Thanks! |
10 tasks
kpp
reviewed
Sep 17, 2019
| express that type by using the opaque type in a "defining use site". | ||
|
|
||
| ```rust,ignore | ||
| struct Struct; |
Contributor
Author
There was a problem hiding this comment.
Yes it should! Feel free to open a PR with a fix :)
Edit: I misread. See comment below.
There was a problem hiding this comment.
Then the whole example should be
fn foo() -> impl Bar {
struct Foo;
impl Bar for Foo { /* stuff */ }
Foo
}?
Contributor
Author
There was a problem hiding this comment.
Sorry, I misread earlier. Really, this code snippet should be read in the context of the previous one. But that's confusing, so maybe we should add the definition of Foo here too. So the complete snippet would be:
type Foo = impl Bar;
struct Struct;
impl Bar for Struct { /* stuff */ }
fn foo() -> Foo {
Struct
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the guide as per the changes in rust-lang/rfcs#2515.