about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-02-16 16:31:47 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-02-17 22:24:34 +1100
commitaf32411f20d4e4f79a2c8b4b645b2693a46c3d7d (patch)
tree44ee4d0ae848413b4dd0c18ddfc7af0db29f1ea3
parent107f14d2cac563608d31f08819380e4ed47e120a (diff)
downloadrust-af32411f20d4e4f79a2c8b4b645b2693a46c3d7d.tar.gz
rust-af32411f20d4e4f79a2c8b4b645b2693a46c3d7d.zip
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.
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs2
1 files changed, 0 insertions, 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))