-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improve lifetime name annotations for closures & async functions #76468
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
/// returns the `i32`. | ||
/// | ||
/// [`OpaqueDef`]: hir::TyKind::OpaqueDef | ||
fn get_future_inner_return_ty(&self, hir_ty: &'tcx hir::Ty<'tcx>) -> &'tcx hir::Ty<'tcx> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this live somewhere more general, like on rustc_middle::hir::map::Map
? Is it useful anywhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r? @estebank |
☔ The latest upstream changes (presumably #77224) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
b32d618
to
074d3e3
Compare
☔ The latest upstream changes (presumably #77552) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
and give return of async fn a better span
074d3e3
to
faa241b
Compare
EDIT: ignore, didn't see the commit |
@estebank this is ready for review |
Just to check, does this fix #75785? |
@tmandry no, this pr would change the output to what is shown in #75785 (comment) which still points at the wrong reference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with nit fixed
faa241b
to
61b52a3
Compare
@rustbot modify labels: -S-waiting-on-author +S-waiting-on-review |
@bors r+ rollup |
📌 Commit 61b52a3 has been approved by |
Rollup of 12 pull requests Successful merges: - rust-lang#74754 (Add `#[cfg(panic = '...')]`) - rust-lang#76468 (Improve lifetime name annotations for closures & async functions) - rust-lang#77016 (Test clippy on PR CI on changes) - rust-lang#78480 (BTreeMap: fix pointer provenance rules) - rust-lang#78502 (Update Chalk to 0.36.0) - rust-lang#78513 (Infer the default host target from the host toolchain if possible) - rust-lang#78566 (Enable LLVM Polly via llvm-args.) - rust-lang#78580 (inliner: Break inlining cycles) - rust-lang#78710 (rustc_ast: Do not panic by default when visiting macro calls) - rust-lang#78746 (Demote i686-unknown-freebsd to tier 2 compiler target) - rust-lang#78830 (fix `super_visit_with` for `Terminator`) - rust-lang#78844 (Monomorphize a type argument of size-of operation during codegen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
&
in the return type of closures (when they have explicit return types) and async functions, like we do for arguments.Addresses Error message in async fn refers to lifetime
'1
without defining it #74072, but I wouldn't call that closed until annotations are identical for async and non-async functions.impl Future
. Addresses Unclear lifetime error in closure producing a future #74497, but further improves could probably be made (why doesn't it appear in the type asimpl Future + '1
?)This is included in the same PR because the changes to
give_name_if_anonymous_region_appears_in_output
would introduce ICE otherwise (it would returnNone
in cases where it didn't previously, which then getsunwrap
ped)