diff options
| author | kadmin <julianknodt@gmail.com> | 2022-01-10 23:39:21 +0000 |
|---|---|---|
| committer | kadmin <julianknodt@gmail.com> | 2022-01-17 19:59:40 +0000 |
| commit | e7529d6a3867ed1692818702b40814ee992eba2d (patch) | |
| tree | 604113f2d4e343f78db6c168ce8624a767de87d7 /src/rustdoc-json-types | |
| parent | 67f56671d0384bdb2d92dddebfbf42510b16e0f7 (diff) | |
Update term for use in more places
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the future, but slightly worried it allows items which are consts which only accept types.
Diffstat (limited to 'src/rustdoc-json-types')
| -rw-r--r-- | src/rustdoc-json-types/lib.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 9466f84ffcd..618c8aab86a 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -148,7 +148,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 +335,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)] @@ -361,6 +361,13 @@ pub enum TraitBoundModifier { #[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")] pub enum Type { /// Structs, enums, and traits |
