Skip to content

Commit 2a2d484

Browse files
committed
1 parent 1eb50be commit 2a2d484

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<a name="v0.14.0"></a>
2+
# [v0.14.0](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.14.0) - 2022-08-15
3+
- Format Version: 18
4+
- Upstream Commit: [`4989f6a7247930ba027fa4b96a0c284f6ab02942`](https://github.com/rust-lang/rust/commit/4989f6a7247930ba027fa4b96a0c284f6ab02942)
5+
- Diff: [v0.14.0...v0.13.1](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.13.1...v0.14.0)
6+
17
<a name="v0.13.1"></a>
28
# [v0.13.1](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.13.1) - 2022-08-10
39
- Format Version: 17

COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0dc39c7bd9795927b903c8c24e89a00788ce3e33
1+
4989f6a7247930ba027fa4b96a0c284f6ab02942

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustdoc-types"
3-
version = "0.13.1"
3+
version = "0.14.0"
44
authors = ["Nixon Enraght-Moony <[email protected]>", "The Rust Project Developers"]
55
edition = "2018"
66
license = "MIT OR Apache-2.0"

src/lib.rs

+20-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::path::PathBuf;
99
use serde::{Deserialize, Serialize};
1010

1111
/// rustdoc format-version.
12-
pub const FORMAT_VERSION: u32 = 17;
12+
pub const FORMAT_VERSION: u32 = 18;
1313

1414
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
1515
/// about the language items in the local crate, as well as info about external items to allow
@@ -133,7 +133,7 @@ pub struct DynTrait {
133133
/// A trait and potential HRTBs
134134
pub struct PolyTrait {
135135
#[serde(rename = "trait")]
136-
pub trait_: Type,
136+
pub trait_: Path,
137137
/// Used for Higher-Rank Trait Bounds (HRTBs)
138138
/// ```text
139139
/// dyn for<'a> Fn() -> &'a i32"
@@ -447,7 +447,7 @@ pub enum WherePredicate {
447447
pub enum GenericBound {
448448
TraitBound {
449449
#[serde(rename = "trait")]
450-
trait_: Type,
450+
trait_: Path,
451451
/// Used for Higher-Rank Trait Bounds (HRTBs)
452452
/// ```text
453453
/// where F: for<'a, 'b> Fn(&'a u8, &'b u8)
@@ -481,12 +481,7 @@ pub enum Term {
481481
#[serde(tag = "kind", content = "inner")]
482482
pub enum Type {
483483
/// Structs, enums, and traits
484-
ResolvedPath {
485-
name: String,
486-
id: Id,
487-
args: Option<Box<GenericArgs>>,
488-
param_names: Vec<GenericBound>,
489-
},
484+
ResolvedPath(Path),
490485
DynTrait(DynTrait),
491486
/// Parameterized types
492487
Generic(String),
@@ -527,10 +522,24 @@ pub enum Type {
527522
args: Box<GenericArgs>,
528523
self_type: Box<Type>,
529524
#[serde(rename = "trait")]
530-
trait_: Box<Type>,
525+
trait_: Path,
531526
},
532527
}
533528

529+
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
530+
pub struct Path {
531+
pub name: String,
532+
pub id: Id,
533+
/// Generic arguments to the type
534+
/// ```test
535+
/// std::borrow::Cow<'static, str>
536+
/// ^^^^^^^^^^^^^^
537+
/// |
538+
/// this part
539+
/// ```
540+
pub args: Option<Box<GenericArgs>>,
541+
}
542+
534543
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
535544
pub struct FunctionPointer {
536545
pub decl: FnDecl,
@@ -574,7 +583,7 @@ pub struct Impl {
574583
pub generics: Generics,
575584
pub provided_trait_methods: Vec<String>,
576585
#[serde(rename = "trait")]
577-
pub trait_: Option<Type>,
586+
pub trait_: Option<Path>,
578587
#[serde(rename = "for")]
579588
pub for_: Type,
580589
pub items: Vec<Id>,

0 commit comments

Comments
 (0)