1
Fork 0

Rename Def::{Param, Foreign} to Def::{TyParam, TyForeign}

This commit is contained in:
varkor 2018-08-22 02:13:31 +01:00
parent 08f3685a82
commit 05cfb3f5b5
17 changed files with 38 additions and 38 deletions

View file

@ -83,7 +83,7 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
ret.extend(build_impls(cx, did, true));
clean::EnumItem(build_enum(cx, did))
}
Def::Foreign(did) => {
Def::TyForeign(did) => {
record_extern_fqn(cx, did, clean::TypeKind::Foreign);
ret.extend(build_impls(cx, did, false));
clean::ForeignTypeItem

View file

@ -2411,7 +2411,7 @@ impl Clean<Type> for hir::Ty {
return new_ty;
}
if let Def::Param(did) = path.def {
if let Def::TyParam(did) = path.def {
if let Some(bounds) = cx.impl_trait_bounds.borrow_mut().remove(&did) {
return ImplTrait(bounds);
}
@ -2460,7 +2460,7 @@ impl Clean<Type> for hir::Ty {
}
hir::GenericParamKind::Type { ref default, .. } => {
let ty_param_def =
Def::Param(cx.tcx.hir.local_def_id(param.id));
Def::TyParam(cx.tcx.hir.local_def_id(param.id));
let mut j = 0;
let type_ = generic_args.args.iter().find_map(|arg| {
match arg {
@ -3710,10 +3710,10 @@ fn resolve_type(cx: &DocContext,
Def::SelfTy(..) if path.segments.len() == 1 => {
return Generic(keywords::SelfType.name().to_string());
}
Def::Param(..) if path.segments.len() == 1 => {
Def::TyParam(..) if path.segments.len() == 1 => {
return Generic(format!("{:#}", path));
}
Def::SelfTy(..) | Def::Param(..) | Def::AssociatedTy(..) => true,
Def::SelfTy(..) | Def::TyParam(..) | Def::AssociatedTy(..) => true,
_ => false,
};
let did = register_def(&*cx, path.def);
@ -3731,7 +3731,7 @@ pub fn register_def(cx: &DocContext, def: Def) -> DefId {
Def::Struct(i) => (i, TypeKind::Struct),
Def::Union(i) => (i, TypeKind::Union),
Def::Mod(i) => (i, TypeKind::Module),
Def::Foreign(i) => (i, TypeKind::Foreign),
Def::TyForeign(i) => (i, TypeKind::Foreign),
Def::Const(i) => (i, TypeKind::Const),
Def::Static(i, _) => (i, TypeKind::Static),
Def::Variant(i) => (cx.tcx.parent_def_id(i).expect("cannot get parent def id"),