Rollup merge of #122406 - compiler-errors:next-solver-asynckind-wf, r=lcnr

Fix WF for `AsyncFnKindHelper` in new trait solver

`to_opt_closure_kind` ICEs when it sees placeholders... so don't do that

no test b/c I'm too lazy to write a no-core test for this, but I could be convinced otherwise

r? lcnr
This commit is contained in:
Matthias Krüger 2024-03-14 15:44:35 +01:00 committed by GitHub
commit 54b73006c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2436,8 +2436,9 @@ pub fn to_opt_closure_kind(self) -> Option<ty::ClosureKind> {
},
// "Bound" types appear in canonical queries when the
// closure type is not yet known
Bound(..) | Param(_) | Infer(_) => None,
// closure type is not yet known, and `Placeholder` and `Param`
// may be encountered in generic `AsyncFnKindHelper` goals.
Bound(..) | Placeholder(_) | Param(_) | Infer(_) => None,
Error(_) => Some(ty::ClosureKind::Fn),