From 2a2d484d320be49984bd41c768f21cf41f9c2a08 Mon Sep 17 00:00:00 2001 From: Nixon Enraght-Moony Date: Mon, 15 Aug 2022 11:23:18 +0100 Subject: [PATCH] v0.14.0 https://github.com/rust-lang/rust/pull/100335 --- CHANGELOG.md | 6 ++++++ COMMIT.txt | 2 +- Cargo.toml | 2 +- src/lib.rs | 31 ++++++++++++++++++++----------- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ca0ef7..e4fa6d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ + +# [v0.14.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.14.0) - 2022-08-15 +- Format Version: 18 +- Upstream Commit: [`4989f6a7247930ba027fa4b96a0c284f6ab02942`](https://github.com/rust-lang/rust/commit/4989f6a7247930ba027fa4b96a0c284f6ab02942) +- Diff: [v0.14.0...v0.13.1](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.13.1...v0.14.0) + # [v0.13.1](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.13.1) - 2022-08-10 - Format Version: 17 diff --git a/COMMIT.txt b/COMMIT.txt index 423cd0e..e3e5b59 100644 --- a/COMMIT.txt +++ b/COMMIT.txt @@ -1 +1 @@ -0dc39c7bd9795927b903c8c24e89a00788ce3e33 +4989f6a7247930ba027fa4b96a0c284f6ab02942 diff --git a/Cargo.toml b/Cargo.toml index 461508f..49a3498 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustdoc-types" -version = "0.13.1" +version = "0.14.0" authors = ["Nixon Enraght-Moony ", "The Rust Project Developers"] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/src/lib.rs b/src/lib.rs index ecdecad..7dcad66 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use serde::{Deserialize, Serialize}; /// rustdoc format-version. -pub const FORMAT_VERSION: u32 = 17; +pub const FORMAT_VERSION: u32 = 18; /// 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 @@ -133,7 +133,7 @@ pub struct DynTrait { /// A trait and potential HRTBs pub struct PolyTrait { #[serde(rename = "trait")] - pub trait_: Type, + pub trait_: Path, /// Used for Higher-Rank Trait Bounds (HRTBs) /// ```text /// dyn for<'a> Fn() -> &'a i32" @@ -447,7 +447,7 @@ pub enum WherePredicate { pub enum GenericBound { TraitBound { #[serde(rename = "trait")] - trait_: Type, + trait_: Path, /// Used for Higher-Rank Trait Bounds (HRTBs) /// ```text /// where F: for<'a, 'b> Fn(&'a u8, &'b u8) @@ -481,12 +481,7 @@ pub enum Term { #[serde(tag = "kind", content = "inner")] pub enum Type { /// Structs, enums, and traits - ResolvedPath { - name: String, - id: Id, - args: Option>, - param_names: Vec, - }, + ResolvedPath(Path), DynTrait(DynTrait), /// Parameterized types Generic(String), @@ -527,10 +522,24 @@ pub enum Type { args: Box, self_type: Box, #[serde(rename = "trait")] - trait_: Box, + trait_: Path, }, } +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Path { + pub name: String, + pub id: Id, + /// Generic arguments to the type + /// ```test + /// std::borrow::Cow<'static, str> + /// ^^^^^^^^^^^^^^ + /// | + /// this part + /// ``` + pub args: Option>, +} + #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct FunctionPointer { pub decl: FnDecl, @@ -574,7 +583,7 @@ pub struct Impl { pub generics: Generics, pub provided_trait_methods: Vec, #[serde(rename = "trait")] - pub trait_: Option, + pub trait_: Option, #[serde(rename = "for")] pub for_: Type, pub items: Vec,