Only split by-ref/by-move futures for async closures
This commit is contained in:
parent
e760daa6a7
commit
05116c5c30
33 changed files with 119 additions and 432 deletions
|
@ -76,16 +76,10 @@ pub(super) fn mangle<'tcx>(
|
|||
}
|
||||
// FIXME(async_closures): This shouldn't be needed when we fix
|
||||
// `Instance::ty`/`Instance::def_id`.
|
||||
ty::InstanceDef::ConstructCoroutineInClosureShim { target_kind, .. }
|
||||
| ty::InstanceDef::CoroutineKindShim { target_kind, .. } => match target_kind {
|
||||
ty::ClosureKind::Fn => unreachable!(),
|
||||
ty::ClosureKind::FnMut => {
|
||||
printer.write_str("{{fn-mut-shim}}").unwrap();
|
||||
}
|
||||
ty::ClosureKind::FnOnce => {
|
||||
printer.write_str("{{fn-once-shim}}").unwrap();
|
||||
}
|
||||
},
|
||||
ty::InstanceDef::ConstructCoroutineInClosureShim { .. }
|
||||
| ty::InstanceDef::CoroutineKindShim { .. } => {
|
||||
printer.write_str("{{fn-once-shim}}").unwrap();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,12 +46,8 @@ pub(super) fn mangle<'tcx>(
|
|||
ty::InstanceDef::VTableShim(_) => Some("vtable"),
|
||||
ty::InstanceDef::ReifyShim(_) => Some("reify"),
|
||||
|
||||
ty::InstanceDef::ConstructCoroutineInClosureShim { target_kind, .. }
|
||||
| ty::InstanceDef::CoroutineKindShim { target_kind, .. } => match target_kind {
|
||||
ty::ClosureKind::Fn => unreachable!(),
|
||||
ty::ClosureKind::FnMut => Some("fn_mut"),
|
||||
ty::ClosureKind::FnOnce => Some("fn_once"),
|
||||
},
|
||||
ty::InstanceDef::ConstructCoroutineInClosureShim { .. }
|
||||
| ty::InstanceDef::CoroutineKindShim { .. } => Some("fn_once"),
|
||||
|
||||
_ => None,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue