about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-07-03 19:38:14 +0200
committerOliver Schneider <github35764891676564198441@oli-obk.de>2018-07-18 10:53:08 +0200
commit53d2ebb0adbe677a811ae130523ebceb285a8029 (patch)
treeaa5bf290ab3240ee1028359cef335f22dc1a2cdb /src/librustdoc/html
parent1c84d8187395b641616649a0f16f15a78ea8bbce (diff)
Implement existential types
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/item_type.rs4
-rw-r--r--src/librustdoc/html/render.rs5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/librustdoc/html/item_type.rs b/src/librustdoc/html/item_type.rs
index 9b8ada1f6e6..a5131e327e0 100644
--- a/src/librustdoc/html/item_type.rs
+++ b/src/librustdoc/html/item_type.rs
@@ -43,6 +43,7 @@ pub enum ItemType {
     Union           = 19,
     ForeignType     = 20,
     Keyword         = 21,
+    Existential     = 22,
 }
 
 
@@ -70,6 +71,7 @@ impl<'a> From<&'a clean::Item> for ItemType {
             clean::EnumItem(..)            => ItemType::Enum,
             clean::FunctionItem(..)        => ItemType::Function,
             clean::TypedefItem(..)         => ItemType::Typedef,
+            clean::ExistentialItem(..)     => ItemType::Existential,
             clean::StaticItem(..)          => ItemType::Static,
             clean::ConstantItem(..)        => ItemType::Constant,
             clean::TraitItem(..)           => ItemType::Trait,
@@ -135,6 +137,7 @@ impl ItemType {
             ItemType::AssociatedConst => "associatedconstant",
             ItemType::ForeignType     => "foreigntype",
             ItemType::Keyword         => "keyword",
+            ItemType::Existential     => "existential",
         }
     }
 
@@ -148,6 +151,7 @@ impl ItemType {
             ItemType::Trait |
             ItemType::Primitive |
             ItemType::AssociatedType |
+            ItemType::Existential |
             ItemType::ForeignType => NameSpace::Type,
 
             ItemType::ExternCrate |
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 41c08dbf4ab..928d7d38351 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1570,6 +1570,7 @@ struct AllTypes {
     macros: HashSet<ItemEntry>,
     functions: HashSet<ItemEntry>,
     typedefs: HashSet<ItemEntry>,
+    existentials: HashSet<ItemEntry>,
     statics: HashSet<ItemEntry>,
     constants: HashSet<ItemEntry>,
     keywords: HashSet<ItemEntry>,
@@ -1586,6 +1587,7 @@ impl AllTypes {
             macros: HashSet::with_capacity(100),
             functions: HashSet::with_capacity(100),
             typedefs: HashSet::with_capacity(100),
+            existentials: HashSet::with_capacity(100),
             statics: HashSet::with_capacity(100),
             constants: HashSet::with_capacity(100),
             keywords: HashSet::with_capacity(100),
@@ -1607,6 +1609,7 @@ impl AllTypes {
                 ItemType::Macro => self.macros.insert(ItemEntry::new(new_url, name)),
                 ItemType::Function => self.functions.insert(ItemEntry::new(new_url, name)),
                 ItemType::Typedef => self.typedefs.insert(ItemEntry::new(new_url, name)),
+                ItemType::Existential => self.existentials.insert(ItemEntry::new(new_url, name)),
                 ItemType::Static => self.statics.insert(ItemEntry::new(new_url, name)),
                 ItemType::Constant => self.constants.insert(ItemEntry::new(new_url, name)),
                 _ => true,
@@ -1650,6 +1653,7 @@ impl fmt::Display for AllTypes {
         print_entries(f, &self.macros, "Macros", "macros")?;
         print_entries(f, &self.functions, "Functions", "functions")?;
         print_entries(f, &self.typedefs, "Typedefs", "typedefs")?;
+        print_entries(f, &self.existentials, "Existentials", "existentials")?;
         print_entries(f, &self.statics, "Statics", "statics")?;
         print_entries(f, &self.constants, "Constants", "constants")
     }
@@ -4400,6 +4404,7 @@ fn item_ty_to_strs(ty: &ItemType) -> (&'static str, &'static str) {
         ItemType::AssociatedConst => ("associated-consts", "Associated Constants"),
         ItemType::ForeignType     => ("foreign-types", "Foreign Types"),
         ItemType::Keyword         => ("keywords", "Keywords"),
+        ItemType::Existential     => ("existentials", "Existentials"),
     }
 }