diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index d22f3adfb016d..dec39007202e1 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -423,8 +423,8 @@ pub fn assert_send_val(_t: &T) {} pub fn assert_send_sync_val(_t: &T) {} pub trait HashMapExt { - /// Same as HashMap::insert, but it may panic if there's already an - /// entry for `key` with a value not equal to `value` + /// Same as [HashMap::insert], but it may panic if there's already an + /// entry for `key` with a value not equal to `value`. fn insert_same(&mut self, key: K, value: V); } diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 82f476b463d63..4daf304463339 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -906,10 +906,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { trait_ref, result, ); // This may overwrite the cache with the same value - // FIXME: Due to #50507 this overwrites the different values - // This should be changed to use HashMapExt::insert_same - // when that is fixed - self.tcx().evaluation_cache.insert(param_env.and(trait_ref), dep_node, result); + self.tcx().evaluation_cache.insert_same(param_env.and(trait_ref), dep_node, result); return; } }