1
Fork 0

is_coroutine -> is_coroutine_or_closure

This commit is contained in:
Michael Goulet 2023-12-30 15:19:54 +00:00
parent d59f06fc64
commit 07adee7072
15 changed files with 29 additions and 22 deletions

View file

@ -72,7 +72,7 @@ impl<'mir, 'tcx> ConstCx<'mir, 'tcx> {
pub fn fn_sig(&self) -> PolyFnSig<'tcx> {
let did = self.def_id().to_def_id();
if self.tcx.is_closure(did) {
if self.tcx.is_closure_or_coroutine(did) {
let ty = self.tcx.type_of(did).instantiate_identity();
let ty::Closure(_, args) = ty.kind() else { bug!("type_of closure not ty::Closure") };
args.as_closure().sig()