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

Address review comments from #98259 #98365

Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jun 22, 2022

It got approved so fast I didn't have time to make changes xD

r? @eholk

…bligation_cause_code`

Most futures don't go through this code path, because they're caught by
`maybe_note_obligation_cause_for_async_await`. But all generators do,
and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses.

At some point, we may want to consider unifying this with the code for `maybe_note_async_await`,
so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points.
But both functions are quite complicated, and it's not clear to me how to combine them;
this seems like a good incremental improvement.
It got merged so fast I didn't have time to make changes xD
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 22, 2022
@jyn514
Copy link
Member Author

jyn514 commented Jun 22, 2022

@eholk are you not part of the org? you should join compiler-contributors :)

anyway, I've assigned esteban, but happy to approve this on your behalf if you have time

@bors delegate=eholk

@bors
Copy link
Contributor

bors commented Jun 22, 2022

✌️ @eholk can now approve this pull request

@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2022
@eholk
Copy link
Contributor

eholk commented Jun 22, 2022

It looks like this includes the patch from #98259, right? I only reviewed the patch on top of that one that addressed review comments since the other PR was already approved.

@bors r+

@bors
Copy link
Contributor

bors commented Jun 22, 2022

📌 Commit b052d76 has been approved by eholk

@bors
Copy link
Contributor

bors commented Jun 22, 2022

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@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 22, 2022
@eholk
Copy link
Contributor

eholk commented Jun 22, 2022

@eholk are you not part of the org? you should join compiler-contributors :)

I'd love to! What's the process for doing this?

@jyn514
Copy link
Member Author

jyn514 commented Jun 22, 2022

Looks like these are the latest guidelines: https://forge.rust-lang.org/compiler/membership.html#how-promotion-decisions-are-made
I'll send an email this afternoon :)

@eholk
Copy link
Contributor

eholk commented Jun 22, 2022

Awesome, thanks!

Comment on lines +2227 to +2228
/// Given a `ty`, return whether it's an `impl Future<...>`.
pub fn ty_is_opaque_future(self, ty: Ty<'_>) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure this can be used in multiple places! I recall seeing similar needs elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, this is the only other place I see looking at opaque Future types:

pub fn get_impl_future_output_ty(&self, ty: Ty<'tcx>) -> Option<Binder<'tcx, Ty<'tcx>>> {

that needs the Output type from the future - maybe I shouldn't have added this method and I should just use get_impl_future_output_ty().is_some() instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that'd be a good idea. Could you make a small PR for it at some point?

compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jun 23, 2022
…view-comments, r=eholk

Address review comments from rust-lang#98259

It got approved so fast I didn't have time to make changes xD

r? `@eholk`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 24, 2022
…piler-errors

Rollup of 16 pull requests

Successful merges:

 - rust-lang#96173 (Fix documentation for  `with_capacity` and `reserve` families of methods)
 - rust-lang#98184 (Give name if anonymous region appears in impl signature)
 - rust-lang#98259 (Greatly improve error reporting for futures and generators in `note_obligation_cause_code`)
 - rust-lang#98269 (Provide a `PathSegment.res` in more cases)
 - rust-lang#98283 (Point at private fields in struct literal)
 - rust-lang#98305 (prohibit_generics: don't alloc error string if no error emitted)
 - rust-lang#98310 (rustdoc: optimize loading of source sidebar)
 - rust-lang#98353 (Migrate two diagnostics from the `rustc_builtin_macros` crate)
 - rust-lang#98355 (Update no_default_libraries handling for emscripten target)
 - rust-lang#98364 (clarify Arc::clone overflow check comment)
 - rust-lang#98365 (Address review comments from rust-lang#98259)
 - rust-lang#98388 (implement `iter_projections` function on `PlaceRef`)
 - rust-lang#98390 (Fixes handling of keywords in rustdoc json output)
 - rust-lang#98409 (triagebot.toml: Allow applying nominated labels)
 - rust-lang#98410 (Update books)
 - rust-lang#98422 (Update browser-ui-test version to 0.9.6)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 667a546 into rust-lang:master Jun 24, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 24, 2022
@jyn514 jyn514 deleted the improve-obligation-errors-review-comments branch July 1, 2022 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants