FunctionItem(Function),
ModuleItem(Module),
TypedefItem(Typedef, bool /* is associated type */),
- ExistentialItem(Existential, bool /* is associated type */),
+ OpaqueTyItem(OpaqueTy, bool /* is associated type */),
StaticItem(Static),
ConstantItem(Constant),
TraitItem(Trait),
ItemEnum::EnumItem(ref e) => &e.generics,
ItemEnum::FunctionItem(ref f) => &f.generics,
ItemEnum::TypedefItem(ref t, _) => &t.generics,
- ItemEnum::ExistentialItem(ref t, _) => &t.generics,
+ ItemEnum::OpaqueTyItem(ref t, _) => &t.generics,
ItemEnum::TraitItem(ref t) => &t.generics,
ItemEnum::ImplItem(ref i) => &i.generics,
ItemEnum::TyMethodItem(ref i) => &i.generics,
items.extend(self.foreigns.iter().map(|x| x.clean(cx)));
items.extend(self.mods.iter().map(|x| x.clean(cx)));
items.extend(self.typedefs.iter().map(|x| x.clean(cx)));
- items.extend(self.existentials.iter().map(|x| x.clean(cx)));
+ items.extend(self.opaque_tys.iter().map(|x| x.clean(cx)));
items.extend(self.statics.iter().map(|x| x.clean(cx)));
items.extend(self.constants.iter().map(|x| x.clean(cx)));
items.extend(self.traits.iter().map(|x| x.clean(cx)));
type_: ty.clean(cx),
generics: Generics::default(),
}, true),
- hir::ImplItemKind::Existential(ref bounds) => ExistentialItem(Existential {
+ hir::ImplItemKind::OpaqueTy(ref bounds) => OpaqueTyItem(OpaqueTy {
bounds: bounds.clean(cx),
generics: Generics::default(),
}, true),
}, true)
}
}
- ty::AssocKind::Existential => unimplemented!(),
+ ty::AssocKind::OpaqueTy => unimplemented!(),
};
let visibility = match self.container {
stability: get_stability(cx, self.def_id),
deprecation: get_deprecation(cx, self.def_id),
def_id: self.def_id,
- attrs: inline::load_attrs(cx, self.def_id),
+ attrs: inline::load_attrs(cx, self.def_id).clean(cx),
source: cx.tcx.def_span(self.def_id).clean(cx),
inner,
}
TyKind::Tup(ref tys) => Tuple(tys.clean(cx)),
TyKind::Def(item_id, _) => {
let item = cx.tcx.hir().expect_item(item_id.id);
- if let hir::ItemKind::Existential(ref ty) = item.node {
+ if let hir::ItemKind::OpaqueTy(ref ty) = item.node {
ImplTrait(ty.bounds.clean(cx))
} else {
unreachable!()
}
};
- if let Some(&hir::ItemKind::Ty(ref ty, ref generics)) = alias {
+ if let Some(&hir::ItemKind::TyAlias(ref ty, ref generics)) = alias {
let provided_params = &path.segments.last().expect("segments were empty");
let mut ty_substs = FxHashMap::default();
let mut lt_substs = FxHashMap::default();
};
Item {
name: Some(self.ident.clean(cx)),
- attrs: inline::load_attrs(cx, self.def_id),
+ attrs: inline::load_attrs(cx, self.def_id).clean(cx),
source: cx.tcx.def_span(self.def_id).clean(cx),
visibility: Some(Inherited),
def_id: self.def_id,
}
#[derive(Clone, Debug)]
-pub struct Existential {
+pub struct OpaqueTy {
pub bounds: Vec<GenericBound>,
pub generics: Generics,
}
-impl Clean<Item> for doctree::Existential<'_> {
+impl Clean<Item> for doctree::OpaqueTy<'_> {
fn clean(&self, cx: &DocContext<'_>) -> Item {
Item {
name: Some(self.name.clean(cx)),
visibility: self.vis.clean(cx),
stability: self.stab.clean(cx),
deprecation: self.depr.clean(cx),
- inner: ExistentialItem(Existential {
- bounds: self.exist_ty.bounds.clean(cx),
- generics: self.exist_ty.generics.clean(cx),
+ inner: OpaqueTyItem(OpaqueTy {
+ bounds: self.opaque_ty.bounds.clean(cx),
+ generics: self.opaque_ty.generics.clean(cx),
}, false),
}
}
let primitive = match *target {
ResolvedPath { did, .. } if did.is_local() => continue,
ResolvedPath { did, .. } => {
- ret.extend(inline::build_impls(cx, did));
+ ret.extend(inline::build_impls(cx, did, None));
continue
}
_ => match target.primitive_type() {
};
if let Some(did) = did {
if !did.is_local() {
- inline::build_impl(cx, did, ret);
+ inline::build_impl(cx, did, None, ret);
}
}
}
},
);
- if let Some(items) = inline::try_inline(cx, res, self.name, &mut visited) {
+ if let Some(items) = inline::try_inline(
+ cx, res, self.name,
+ Some(rustc::ty::Attributes::Borrowed(self.attrs)),
+ &mut visited
+ ) {
return items;
}
}
}
if !denied {
let mut visited = FxHashSet::default();
- if let Some(items) = inline::try_inline(cx, path.res, name, &mut visited) {
+ if let Some(items) = inline::try_inline(
+ cx, path.res, name,
+ Some(rustc::ty::Attributes::Borrowed(self.attrs)),
+ &mut visited
+ ) {
return items;
}
}