ForeignFunctionItem(Function),
/// `static`s from an extern block
ForeignStaticItem(Static),
+ /// `type`s from an extern block
+ ForeignTypeItem,
MacroItem(Macro),
PrimitiveItem(PrimitiveType),
AssociatedConstItem(Type, Option<String>),
AssociatedTypeItem(Vec<TyParamBound>, Option<Type>),
- DefaultImplItem(DefaultImpl),
+ AutoImplItem(AutoImpl),
/// An item that has been stripped by a rustdoc pass
StrippedItem(Box<ItemEnum>),
}
pub abi: Abi,
}
-impl<'a> Clean<Method> for (&'a hir::MethodSig, hir::BodyId) {
+impl<'a> Clean<Method> for (&'a hir::MethodSig, &'a hir::Generics, hir::BodyId) {
fn clean(&self, cx: &DocContext) -> Method {
Method {
- generics: self.0.generics.clean(cx),
+ generics: self.1.clean(cx),
unsafety: self.0.unsafety,
constness: self.0.constness,
- decl: (&*self.0.decl, self.1).clean(cx),
+ decl: (&*self.0.decl, self.2).clean(cx),
abi: self.0.abi
}
}
default.map(|e| print_const_expr(cx, e)))
}
hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Provided(body)) => {
- MethodItem((sig, body).clean(cx))
+ MethodItem((sig, &self.generics, body).clean(cx))
}
hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Required(ref names)) => {
TyMethodItem(TyMethod {
unsafety: sig.unsafety.clone(),
decl: (&*sig.decl, &names[..]).clean(cx),
- generics: sig.generics.clean(cx),
+ generics: self.generics.clean(cx),
abi: sig.abi
})
}
Some(print_const_expr(cx, expr)))
}
hir::ImplItemKind::Method(ref sig, body) => {
- MethodItem((sig, body).clean(cx))
+ MethodItem((sig, &self.generics, body).clean(cx))
}
hir::ImplItemKind::Type(ref ty) => TypedefItem(Typedef {
type_: ty.clean(cx),
Trait,
Variant,
Typedef,
+ Foreign,
}
pub trait GetDefId {
}
}
TyBareFn(ref barefn) => BareFunction(box barefn.clean(cx)),
- TyImplTrait(ref bounds) => ImplTrait(bounds.clean(cx)),
+ TyImplTraitExistential(ref exist_ty, ref _lts) => ImplTrait(exist_ty.bounds.clean(cx)),
+ TyImplTraitUniversal(_, ref bounds) => ImplTrait(bounds.clean(cx)),
TyInfer | TyErr => Infer,
TyTypeof(..) => panic!("Unimplemented type {:?}", self.node),
}
is_generic: false,
}
}
+ ty::TyForeign(did) => {
+ inline::record_extern_fqn(cx, did, TypeKind::Foreign);
+ let path = external_path(cx, &cx.tcx.item_name(did),
+ None, false, vec![], Substs::empty());
+ ResolvedPath {
+ path: path,
+ typarams: None,
+ did: did,
+ is_generic: false,
+ }
+ }
ty::TyDynamic(ref obj, ref reg) => {
if let Some(principal) = obj.principal() {
let did = principal.def_id();
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
-pub struct DefaultImpl {
+pub struct AutoImpl {
pub unsafety: hir::Unsafety,
pub trait_: Type,
}
-impl Clean<Item> for doctree::DefaultImpl {
+impl Clean<Item> for doctree::AutoImpl {
fn clean(&self, cx: &DocContext) -> Item {
Item {
name: None,
visibility: Some(Public),
stability: None,
deprecation: None,
- inner: DefaultImplItem(DefaultImpl {
+ inner: AutoImplItem(AutoImpl {
unsafety: self.unsafety,
trait_: self.trait_.clean(cx),
}),
expr: "".to_string(),
})
}
+ hir::ForeignItemType => {
+ ForeignTypeItem
+ }
};
Item {
name: Some(self.name.clean(cx)),