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.
This commit is contained in:
parent
a3bb8585e8
commit
1cb1f00d40
3 changed files with 9 additions and 16 deletions
|
@ -34,8 +34,7 @@ pub enum ItemType {
|
||||||
Method = 10,
|
Method = 10,
|
||||||
StructField = 11,
|
StructField = 11,
|
||||||
Variant = 12,
|
Variant = 12,
|
||||||
ForeignFunction = 13,
|
// we used to have ForeignFunction and ForeignStatic. they are retired now.
|
||||||
ForeignStatic = 14,
|
|
||||||
Macro = 15,
|
Macro = 15,
|
||||||
Primitive = 16,
|
Primitive = 16,
|
||||||
AssociatedType = 17,
|
AssociatedType = 17,
|
||||||
|
@ -59,8 +58,8 @@ impl ItemType {
|
||||||
clean::MethodItem(..) => ItemType::Method,
|
clean::MethodItem(..) => ItemType::Method,
|
||||||
clean::StructFieldItem(..) => ItemType::StructField,
|
clean::StructFieldItem(..) => ItemType::StructField,
|
||||||
clean::VariantItem(..) => ItemType::Variant,
|
clean::VariantItem(..) => ItemType::Variant,
|
||||||
clean::ForeignFunctionItem(..) => ItemType::ForeignFunction,
|
clean::ForeignFunctionItem(..) => ItemType::Function, // no ForeignFunction
|
||||||
clean::ForeignStaticItem(..) => ItemType::ForeignStatic,
|
clean::ForeignStaticItem(..) => ItemType::Static, // no ForeignStatic
|
||||||
clean::MacroItem(..) => ItemType::Macro,
|
clean::MacroItem(..) => ItemType::Macro,
|
||||||
clean::PrimitiveItem(..) => ItemType::Primitive,
|
clean::PrimitiveItem(..) => ItemType::Primitive,
|
||||||
clean::AssociatedTypeItem(..) => ItemType::AssociatedType,
|
clean::AssociatedTypeItem(..) => ItemType::AssociatedType,
|
||||||
|
@ -95,8 +94,6 @@ impl ItemType {
|
||||||
ItemType::Method => "method",
|
ItemType::Method => "method",
|
||||||
ItemType::StructField => "structfield",
|
ItemType::StructField => "structfield",
|
||||||
ItemType::Variant => "variant",
|
ItemType::Variant => "variant",
|
||||||
ItemType::ForeignFunction => "ffi",
|
|
||||||
ItemType::ForeignStatic => "ffs",
|
|
||||||
ItemType::Macro => "macro",
|
ItemType::Macro => "macro",
|
||||||
ItemType::Primitive => "primitive",
|
ItemType::Primitive => "primitive",
|
||||||
ItemType::AssociatedType => "associatedtype",
|
ItemType::AssociatedType => "associatedtype",
|
||||||
|
|
|
@ -1495,12 +1495,10 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
|
||||||
ItemType::Enum => 5,
|
ItemType::Enum => 5,
|
||||||
ItemType::Constant => 6,
|
ItemType::Constant => 6,
|
||||||
ItemType::Static => 7,
|
ItemType::Static => 7,
|
||||||
ItemType::ForeignFunction => 8,
|
ItemType::Trait => 8,
|
||||||
ItemType::ForeignStatic => 9,
|
ItemType::Function => 9,
|
||||||
ItemType::Trait => 10,
|
ItemType::Typedef => 10,
|
||||||
ItemType::Function => 11,
|
_ => 11 + ty as u8,
|
||||||
ItemType::Typedef => 12,
|
|
||||||
_ => 13 + ty as u8,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1559,8 +1557,6 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
|
||||||
ItemType::Method => ("methods", "Methods"),
|
ItemType::Method => ("methods", "Methods"),
|
||||||
ItemType::StructField => ("fields", "Struct Fields"),
|
ItemType::StructField => ("fields", "Struct Fields"),
|
||||||
ItemType::Variant => ("variants", "Variants"),
|
ItemType::Variant => ("variants", "Variants"),
|
||||||
ItemType::ForeignFunction => ("ffi-fns", "Foreign Functions"),
|
|
||||||
ItemType::ForeignStatic => ("ffi-statics", "Foreign Statics"),
|
|
||||||
ItemType::Macro => ("macros", "Macros"),
|
ItemType::Macro => ("macros", "Macros"),
|
||||||
ItemType::Primitive => ("primitives", "Primitive Types"),
|
ItemType::Primitive => ("primitives", "Primitive Types"),
|
||||||
ItemType::AssociatedType => ("associated-types", "Associated Types"),
|
ItemType::AssociatedType => ("associated-types", "Associated Types"),
|
||||||
|
|
|
@ -566,8 +566,8 @@
|
||||||
"method",
|
"method",
|
||||||
"structfield",
|
"structfield",
|
||||||
"variant",
|
"variant",
|
||||||
"ffi",
|
"ffi", // retained for backward compatibility
|
||||||
"ffs",
|
"ffs", // retained for backward compatibility
|
||||||
"macro",
|
"macro",
|
||||||
"primitive",
|
"primitive",
|
||||||
"associatedtype",
|
"associatedtype",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue