1
Fork 0

Auto merge of #108006 - cjgillot:def-impl, r=oli-obk

Avoid accessing HIR when it can be avoided

Experiment to see if it helps some incremental cases.

Will be rebased once https://github.com/rust-lang/rust/pull/107942 gets merged.

r? `@ghost`
This commit is contained in:
bors 2023-02-15 16:14:10 +00:00
commit 2d14db321b
43 changed files with 316 additions and 777 deletions

View file

@ -1061,7 +1061,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
};
let parent_def_id = generics.parent.unwrap();
if tcx.def_kind(parent_def_id) == DefKind::Impl {
if let DefKind::Impl { .. } = tcx.def_kind(parent_def_id) {
let parent_ty = tcx.bound_type_of(parent_def_id).subst(tcx, substs);
match (parent_ty.kind(), &ty.kind) {
(