Skip to content

Commit c9870cf

Browse files
supertrait_def_ids
1 parent 81c2c57 commit c9870cf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_middle/src/ty/context.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2443,7 +2443,7 @@ impl<'tcx> TyCtxt<'tcx> {
24432443
/// Given the def_id of a Trait `trait_def_id` and the name of an associated item `assoc_name`
24442444
/// returns true if the `trait_def_id` defines an associated item of name `assoc_name`.
24452445
pub fn trait_may_define_assoc_item(self, trait_def_id: DefId, assoc_name: Ident) -> bool {
2446-
self.super_traits_of(trait_def_id).any(|trait_did| {
2446+
self.supertrait_def_ids(trait_def_id).any(|trait_did| {
24472447
self.associated_items(trait_did)
24482448
.filter_by_name_unhygienic(assoc_name.name)
24492449
.any(|item| self.hygienic_eq(assoc_name, item.ident(self), trait_did))
@@ -2467,8 +2467,7 @@ impl<'tcx> TyCtxt<'tcx> {
24672467
/// Computes the def-ids of the transitive supertraits of `trait_def_id`. This (intentionally)
24682468
/// does not compute the full elaborated super-predicates but just the set of def-ids. It is used
24692469
/// to identify which traits may define a given associated type to help avoid cycle errors.
2470-
/// Returns a `DefId` iterator.
2471-
fn super_traits_of(self, trait_def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
2470+
fn supertrait_def_ids(self, trait_def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
24722471
let mut set = FxHashSet::default();
24732472
let mut stack = vec![trait_def_id];
24742473

0 commit comments

Comments
 (0)