Properly skip RPITITs from ModChild and give a name in AssocItem
This commit is contained in:
parent
76b0cf812b
commit
66714658d0
@ -404,12 +404,8 @@ impl DefPathData {
|
||||
match *self {
|
||||
TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => Some(name),
|
||||
|
||||
// We use this name when collecting `ModChild`s.
|
||||
// FIXME this could probably be removed with some refactoring to the name resolver.
|
||||
ImplTraitAssocTy => Some(kw::Empty),
|
||||
|
||||
Impl | ForeignMod | CrateRoot | Use | GlobalAsm | ClosureExpr | Ctor | AnonConst
|
||||
| ImplTrait => None,
|
||||
| ImplTrait | ImplTraitAssocTy => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1021,7 +1021,9 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
||||
} else {
|
||||
// Iterate over all children.
|
||||
for child_index in self.root.tables.children.get(self, id).unwrap().decode(self) {
|
||||
yield self.get_mod_child(child_index, sess);
|
||||
if self.root.tables.opt_rpitit_info.get(self, child_index).is_none() {
|
||||
yield self.get_mod_child(child_index, sess);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(reexports) = self.root.tables.module_reexports.get(self, id) {
|
||||
@ -1067,8 +1069,11 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
||||
}
|
||||
|
||||
fn get_associated_item(self, id: DefIndex, sess: &'a Session) -> ty::AssocItem {
|
||||
let name = self.item_name(id);
|
||||
|
||||
let name = if self.root.tables.opt_rpitit_info.get(self, id).is_some() {
|
||||
kw::Empty
|
||||
} else {
|
||||
self.item_name(id)
|
||||
};
|
||||
let (kind, has_self) = match self.def_kind(id) {
|
||||
DefKind::AssocConst => (ty::AssocKind::Const, false),
|
||||
DefKind::AssocFn => (ty::AssocKind::Fn, self.get_fn_has_self_parameter(id, sess)),
|
||||
|
@ -10,7 +10,7 @@ note: required by a bound in `Foo::{opaque#0}`
|
||||
--> $DIR/doesnt-satisfy.rs:8:22
|
||||
|
|
||||
LL | fn bar() -> impl std::fmt::Display;
|
||||
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::`
|
||||
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user