]> git.lizzy.rs Git - rust.git/blobdiff - src/rustdoc-json-types/lib.rs
Rollup merge of #93155 - dtolnay:blockindent, r=nagisa
[rust.git] / src / rustdoc-json-types / lib.rs
index 9466f84ffcd59192dce3492270034af4efdfdd0a..600833664be5ed5ce0b08fb5394df609636865c4 100644 (file)
@@ -8,6 +8,9 @@
 
 use serde::{Deserialize, Serialize};
 
+/// rustdoc format-version.
+pub const FORMAT_VERSION: u32 = 10;
+
 /// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
 /// about the language items in the local crate, as well as info about external items to allow
 /// tools to find or link to them.
@@ -148,7 +151,7 @@ pub struct TypeBinding {
 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
 #[serde(rename_all = "snake_case")]
 pub enum TypeBindingKind {
-    Equality(Type),
+    Equality(Term),
     Constraint(Vec<GenericBound>),
 }
 
@@ -335,7 +338,7 @@ pub enum GenericParamDefKind {
 pub enum WherePredicate {
     BoundPredicate { ty: Type, bounds: Vec<GenericBound> },
     RegionPredicate { lifetime: String, bounds: Vec<GenericBound> },
-    EqPredicate { lhs: Type, rhs: Type },
+    EqPredicate { lhs: Type, rhs: Term },
 }
 
 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
@@ -359,6 +362,13 @@ pub enum TraitBoundModifier {
     MaybeConst,
 }
 
+#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
+#[serde(rename_all = "snake_case")]
+pub enum Term {
+    Type(Type),
+    Constant(Constant),
+}
+
 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
 #[serde(rename_all = "snake_case")]
 #[serde(tag = "kind", content = "inner")]
@@ -510,8 +520,5 @@ pub struct Static {
     pub expr: String,
 }
 
-/// rustdoc format-version.
-pub const FORMAT_VERSION: u32 = 9;
-
 #[cfg(test)]
 mod tests;