diff options
| author | Michael Goulet <michael@errs.io> | 2024-01-25 19:17:21 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-02-06 02:22:58 +0000 |
| commit | c98d6994a390044410c55c45195d330e4c8cd3d7 (patch) | |
| tree | 52cd52eceb02c3bbfd65cff7f227417b27a68a84 /compiler/rustc_ty_utils/src/instance.rs | |
| parent | 37184e86ea58bc90b8cd97f877d52ccce8ea02ab (diff) | |
| download | rust-c98d6994a390044410c55c45195d330e4c8cd3d7.tar.gz rust-c98d6994a390044410c55c45195d330e4c8cd3d7.zip | |
More comments, final tweaks
Diffstat (limited to 'compiler/rustc_ty_utils/src/instance.rs')
| -rw-r--r-- | compiler/rustc_ty_utils/src/instance.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index fc224d242db..9faad10dd14 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -287,6 +287,13 @@ fn resolve_associated_item<'tcx>( { match *rcvr_args.type_at(0).kind() { ty::CoroutineClosure(coroutine_closure_def_id, args) => { + // If we're computing `AsyncFnOnce`/`AsyncFnMut` for a by-ref closure, + // or `AsyncFnOnce` for a by-mut closure, then construct a new body that + // has the right return types. + // + // Specifically, `AsyncFnMut` for a by-ref coroutine-closure just needs + // to have its input and output types fixed (`&mut self` and returning + // `i16` coroutine kind). if target_kind > args.as_coroutine_closure().kind() { Some(Instance { def: ty::InstanceDef::ConstructCoroutineInClosureShim { |
