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 various coments to explain how the TAIT code works #86437

Merged
merged 2 commits into from
Jun 19, 2021

Conversation

nikomatsakis
Copy link
Contributor

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 18, 2021
Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

Something in the docs doesn't add up 100%, r=me with that fixed

/// * `anon_ty` would be `Box<Foo<T>>` where `Foo` is an opaque type
/// scoped to this function (note that it is parameterized by the
/// generics of `foo`).
/// * `revealed_ty` would be `Box<(Foo<T>, u32)>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// * `revealed_ty` would be `Box<(Foo<T>, u32)>`
/// * `revealed_ty` would be `Box<(T, u32)>`

Copy link
Contributor

Choose a reason for hiding this comment

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

and then this would actually just be (T, u32)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct

///
/// In terms of our function parameters:
///
/// * `anon_ty` would be `Box<Foo<T>>` where `Foo` is an opaque type
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the anon_ty just Foo<T>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's not. It's the return type, which contains opaque types (but also maybe other stuff). That's explicitly why I included the Box in the example. Let me clarify that.

@nikomatsakis
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Jun 18, 2021

📌 Commit 831759a has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 18, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 19, 2021
add various coments to explain how the TAIT code works

r? `@oli-obk`
@bors
Copy link
Contributor

bors commented Jun 19, 2021

⌛ Testing commit 831759a with merge 29cd70d...

@bors
Copy link
Contributor

bors commented Jun 19, 2021

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 29cd70d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 19, 2021
@bors bors merged commit 29cd70d into rust-lang:master Jun 19, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants