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

Don't duplicate anonymous lifetimes for async fn in traits #110965

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

compiler-errors
Copy link
Member

record_lifetime_params_for_async needs to be called outside of the scope of the function, or else it'll end up collecting anonymous lifetimes twice (those on the function and those within the AnonymousCreateParameter rib). This matches how record_lifetime_params_for_async is being used for functions with bodies below.

This fixes (partially) #110963 when the lifetimes are late-bound, but does not do so when the lifetimes are early-bound (as seen from the known-bug that I added).

@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2023

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 28, 2023
@cjgillot
Copy link
Contributor

r=me if CI is green

@compiler-errors
Copy link
Member Author

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Apr 28, 2023

📌 Commit 4e05cfb has been approved by cjgillot

It is now in the queue for this repository.

@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 Apr 28, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 29, 2023
… r=cjgillot

Don't duplicate anonymous lifetimes for async fn in traits

`record_lifetime_params_for_async` needs to be called outside of the scope of the function, or else it'll end up collecting anonymous lifetimes twice (those on the function and those within the `AnonymousCreateParameter` rib). This matches how `record_lifetime_params_for_async` is being used for functions with bodies below.

This fixes (partially) rust-lang#110963 when the lifetimes are late-bound, but does not do so when the lifetimes are early-bound (as seen from the known-bug that I added).
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#110614 (Clear response values for overflow in new solver)
 - rust-lang#110894 (Bump libffi-sys to 2.3.0)
 - rust-lang#110932 (include source error for LoadLibraryExW)
 - rust-lang#110958 (Make sure that some stdlib method signatures aren't accidental refinements)
 - rust-lang#110962 (Make drop_flags an IndexVec.)
 - rust-lang#110965 (Don't duplicate anonymous lifetimes for async fn in traits)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 81910a1 into rust-lang:master Apr 29, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 29, 2023
@compiler-errors compiler-errors deleted the anon-lt-dupe-oops branch August 11, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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