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

Make sure async constructs do not impl Generator #105094

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

Swatinem
Copy link
Contributor

Async lowering turns async functions and blocks into generators internally.
Though these special kinds of generators should not impl Generator themselves.
The other way around, normal generators should not impl Future.

This was discovered in #105082 (comment) and is a regression from #104321.

r? @compiler-errors

@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 Nov 30, 2022
Async lowering turns async functions and blocks into generators internally.
Though these special kinds of generators should not `impl Generator` themselves.
The other way around, normal generators should not `impl Future`.
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 3, 2022

📌 Commit b5ae4c9 has been approved by compiler-errors

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 Dec 3, 2022
@bors
Copy link
Contributor

bors commented Dec 4, 2022

⌛ Testing commit b5ae4c9 with merge d144956...

@bors
Copy link
Contributor

bors commented Dec 5, 2022

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing d144956 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 5, 2022
@bors bors merged commit d144956 into rust-lang:master Dec 5, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 5, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d144956): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [1.7%, 3.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

@Swatinem Swatinem deleted the generator-not-future branch December 5, 2022 07:43
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…piler-errors

Make sure async constructs do not `impl Generator`

Async lowering turns async functions and blocks into generators internally.
Though these special kinds of generators should not `impl Generator` themselves.
The other way around, normal generators should not `impl Future`.

This was discovered in rust-lang#105082 (comment) and is a regression from rust-lang#104321.

r? `@compiler-errors`
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. 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