Skip to content

Return value of coroutine_layout fn changed to Result with LayoutError #140926

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

azhogin
Copy link
Contributor

@azhogin azhogin commented May 11, 2025

Continue of #140902:
coroutine_layout fn is now returns Result with LayoutError to have consistent error with layout_of_uncached.
async_drop_coroutine_layout fn is now return LayoutError::TooGeneric in case of not-fully-specialized async_drop_in_place<T>::{closure} coroutine.

@rustbot
Copy link
Collaborator

rustbot commented May 11, 2025

r? @oli-obk

rustbot has assigned @oli-obk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 May 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 11, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@@ -100,10 +102,11 @@ impl<'tcx> ty::CoroutineArgs<TyCtxt<'tcx>> {
#[inline]
fn discriminants(
self,
ty: Ty<'tcx>,
Copy link
Member

Choose a reason for hiding this comment

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

The doc comment should explain the meaning of the new argument and how it relates to self.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since it is only used for the Unknown layout error, reconstruct it with Ty::new_coroutine maybe?

@azhogin azhogin force-pushed the azhogin/async-drop-coroutine-layout-returns-layout-error branch from 9ce3d8a to ba80d82 Compare May 11, 2025 16:53
@petrochenkov petrochenkov added the F-async_drop `#![feature(async_drop)]` label May 12, 2025
@oli-obk
Copy link
Contributor

oli-obk commented May 13, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 13, 2025

📌 Commit ba80d82 has been approved by oli-obk

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 May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-async_drop `#![feature(async_drop)]` 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.

6 participants