1
Fork 0

Rollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errors

Refactor `ty::ClosureKind` related stuff

I've tried to fix all duplication and weirdness, but if I missed something do tell :p

r? `@compiler-errors`
This commit is contained in:
Dylan DPC 2022-11-28 15:42:10 +05:30 committed by GitHub
commit f90484df8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 46 additions and 62 deletions

View file

@ -106,7 +106,7 @@ fn external_generic_args<'tcx>(
) -> GenericArgs {
let args = substs_to_args(cx, substs, has_self);
if cx.tcx.fn_trait_kind_from_lang_item(did).is_some() {
if cx.tcx.fn_trait_kind_from_def_id(did).is_some() {
let inputs =
// The trait's first substitution is the one after self, if there is one.
match substs.iter().nth(if has_self { 1 } else { 0 }).unwrap().expect_ty().kind() {