提交 1cb1f00d 编写于 作者: K Kang Seonghoon

rustdoc: Removed Foreign{Function,Static} item types.

They are just (unsafe) functions and static items to most users
and even compilers! The metadata doesn't distinguish them, so Rustdoc
ended up producing broken links (generated `ffi.*.html`, links to
`fn.*.html`). It would be best to avoid this pitfall at all.
上级 a3bb8585
......@@ -34,8 +34,7 @@ pub enum ItemType {
Method = 10,
StructField = 11,
Variant = 12,
ForeignFunction = 13,
ForeignStatic = 14,
// we used to have ForeignFunction and ForeignStatic. they are retired now.
Macro = 15,
Primitive = 16,
AssociatedType = 17,
......@@ -59,8 +58,8 @@ pub fn from_item(item: &clean::Item) -> ItemType {
clean::MethodItem(..) => ItemType::Method,
clean::StructFieldItem(..) => ItemType::StructField,
clean::VariantItem(..) => ItemType::Variant,
clean::ForeignFunctionItem(..) => ItemType::ForeignFunction,
clean::ForeignStaticItem(..) => ItemType::ForeignStatic,
clean::ForeignFunctionItem(..) => ItemType::Function, // no ForeignFunction
clean::ForeignStaticItem(..) => ItemType::Static, // no ForeignStatic
clean::MacroItem(..) => ItemType::Macro,
clean::PrimitiveItem(..) => ItemType::Primitive,
clean::AssociatedTypeItem(..) => ItemType::AssociatedType,
......@@ -95,8 +94,6 @@ pub fn to_static_str(&self) -> &'static str {
ItemType::Method => "method",
ItemType::StructField => "structfield",
ItemType::Variant => "variant",
ItemType::ForeignFunction => "ffi",
ItemType::ForeignStatic => "ffs",
ItemType::Macro => "macro",
ItemType::Primitive => "primitive",
ItemType::AssociatedType => "associatedtype",
......
......@@ -1495,12 +1495,10 @@ fn reorder(ty: ItemType) -> u8 {
ItemType::Enum => 5,
ItemType::Constant => 6,
ItemType::Static => 7,
ItemType::ForeignFunction => 8,
ItemType::ForeignStatic => 9,
ItemType::Trait => 10,
ItemType::Function => 11,
ItemType::Typedef => 12,
_ => 13 + ty as u8,
ItemType::Trait => 8,
ItemType::Function => 9,
ItemType::Typedef => 10,
_ => 11 + ty as u8,
}
}
......@@ -1559,8 +1557,6 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: uint, idx2: uint) -> Ordering {
ItemType::Method => ("methods", "Methods"),
ItemType::StructField => ("fields", "Struct Fields"),
ItemType::Variant => ("variants", "Variants"),
ItemType::ForeignFunction => ("ffi-fns", "Foreign Functions"),
ItemType::ForeignStatic => ("ffi-statics", "Foreign Statics"),
ItemType::Macro => ("macros", "Macros"),
ItemType::Primitive => ("primitives", "Primitive Types"),
ItemType::AssociatedType => ("associated-types", "Associated Types"),
......
......@@ -566,8 +566,8 @@
"method",
"structfield",
"variant",
"ffi",
"ffs",
"ffi", // retained for backward compatibility
"ffs", // retained for backward compatibility
"macro",
"primitive",
"associatedtype",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册