-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
base: master
Are you sure you want to change the base?
Return value of coroutine_layout fn changed to Result with LayoutError #140926
Conversation
compiler/rustc_middle/src/ty/sty.rs
Outdated
@@ -100,10 +102,11 @@ impl<'tcx> ty::CoroutineArgs<TyCtxt<'tcx>> { | |||
#[inline] | |||
fn discriminants( | |||
self, | |||
ty: 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.
The doc comment should explain the meaning of the new argument and how it relates to self
.
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.
Since it is only used for the Unknown layout error, reconstruct it with Ty::new_coroutine maybe?
9ce3d8a
to
ba80d82
Compare
@bors r+ rollup |
Continue of #140902:
coroutine_layout
fn is now returnsResult
withLayoutError
to have consistent error withlayout_of_uncached
.async_drop_coroutine_layout
fn is now returnLayoutError::TooGeneric
in case of not-fully-specializedasync_drop_in_place<T>::{closure}
coroutine.