Skip to content

Commit 94ce4c4

Browse files
committed
1 parent c8c9e39 commit 94ce4c4

File tree

4 files changed

+42
-6
lines changed

4 files changed

+42
-6
lines changed

CHANGELOG.md

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

COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1a15c7147f90afaa64ae3ff27fcbd678e2e44a8e
1+
a856e57f6cc8ba8bb83c5abadce338f589df6b10

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.12.0"
3+
version = "0.13.0"
44
authors = ["Nixon Enraght-Moony <nixon.emoony@gmail.com>", "The Rust Project Developers"]
55
edition = "2018"
66
license = "MIT OR Apache-2.0"

src/lib.rs

+34-4
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 = 16;
12+
pub const FORMAT_VERSION: u32 = 17;
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
@@ -115,6 +115,35 @@ pub enum Visibility {
115115
},
116116
}
117117

118+
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
119+
pub struct DynTrait {
120+
/// All the traits implemented. One of them is the vtable, and the rest must be auto traits.
121+
pub traits: Vec<PolyTrait>,
122+
/// The lifetime of the whole dyn object
123+
/// ```text
124+
/// dyn Debug + 'static
125+
/// ^^^^^^^
126+
/// |
127+
/// this part
128+
/// ```
129+
pub lifetime: Option<String>,
130+
}
131+
132+
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
133+
/// A trait and potential HRTBs
134+
pub struct PolyTrait {
135+
#[serde(rename = "trait")]
136+
pub trait_: Type,
137+
/// Used for Higher-Rank Trait Bounds (HRTBs)
138+
/// ```text
139+
/// dyn for<'a> Fn() -> &'a i32"
140+
/// ^^^^^^^
141+
/// |
142+
/// this part
143+
/// ```
144+
pub generic_params: Vec<GenericParamDef>,
145+
}
146+
118147
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
119148
#[serde(rename_all = "snake_case")]
120149
pub enum GenericArgs {
@@ -395,7 +424,7 @@ pub enum WherePredicate {
395424
type_: Type,
396425
bounds: Vec<GenericBound>,
397426
/// Used for Higher-Rank Trait Bounds (HRTBs)
398-
/// ```plain
427+
/// ```text
399428
/// where for<'a> &'a T: Iterator,"
400429
/// ^^^^^^^
401430
/// |
@@ -420,7 +449,7 @@ pub enum GenericBound {
420449
#[serde(rename = "trait")]
421450
trait_: Type,
422451
/// Used for Higher-Rank Trait Bounds (HRTBs)
423-
/// ```plain
452+
/// ```text
424453
/// where F: for<'a, 'b> Fn(&'a u8, &'b u8)
425454
/// ^^^^^^^^^^^
426455
/// |
@@ -458,6 +487,7 @@ pub enum Type {
458487
args: Option<Box<GenericArgs>>,
459488
param_names: Vec<GenericBound>,
460489
},
490+
DynTrait(DynTrait),
461491
/// Parameterized types
462492
Generic(String),
463493
/// Fixed-size numeric types (plus int/usize/float), char, arrays, slices, and tuples
@@ -505,7 +535,7 @@ pub enum Type {
505535
pub struct FunctionPointer {
506536
pub decl: FnDecl,
507537
/// Used for Higher-Rank Trait Bounds (HRTBs)
508-
/// ```plain
538+
/// ```text
509539
/// for<'c> fn(val: &'c i32) -> i32
510540
/// ^^^^^^^
511541
/// |

0 commit comments

Comments
 (0)