Skip to content

Commit f8b15d8

Browse files
committed
rustdoc: Don't enter an infer_ctxt in get_blanket_impls for impls that aren't blanket impls
1 parent 66ec64c commit f8b15d8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/librustdoc/clean/blanket_impl.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
3232
trait_def_id, impl_def_id
3333
);
3434
let trait_ref = self.cx.tcx.impl_trait_ref(impl_def_id).unwrap();
35-
let may_apply = self.cx.tcx.infer_ctxt().enter(|infcx| {
36-
match trait_ref.self_ty().kind() {
37-
ty::Param(_) => {}
38-
_ => return false,
39-
}
40-
35+
let is_param = matches!(trait_ref.self_ty().kind(), ty::Param(_));
36+
let may_apply = is_param && self.cx.tcx.infer_ctxt().enter(|infcx| {
4137
let substs = infcx.fresh_substs_for_item(DUMMY_SP, item_def_id);
4238
let ty = ty.subst(infcx.tcx, substs);
4339
let param_env = param_env.subst(infcx.tcx, substs);

0 commit comments

Comments
 (0)