From af32411f20d4e4f79a2c8b4b645b2693a46c3d7d Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 16 Feb 2023 16:31:47 +1100 Subject: [PATCH] Avoid double-interning some `BoundVariableKind`s. This function has this line twice: ``` let bound_vars = tcx.intern_bound_variable_kinds(&bound_vars); ``` The second occurrence is effectively a no-op, because the first occurrence interned any that needed it. --- .../rustc_trait_selection/src/traits/select/confirmation.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 60a78e642c3..e4a832e4728 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -566,8 +566,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { }); let bound_vars = tcx.intern_bound_variable_kinds(&bound_vars); let assoc_ty_substs = tcx.intern_substs(&substs); - - let bound_vars = tcx.intern_bound_variable_kinds(&bound_vars); let bound = bound.map_bound(|b| b.kind().skip_binder()).subst(tcx, assoc_ty_substs); tcx.mk_predicate(ty::Binder::bind_with_vars(bound, bound_vars))