Skip to content

Commit c3efbeb

Browse files
committed
v0.7.0
1 parent ebef0a5 commit c3efbeb

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

COMMIT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1521b53c532ccd90c504b0c860cd5662172cc05e
1+
aa601574a5fe861bffd641beccf59c7be3ed16c9

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustdoc-types"
3-
version = "0.6.0"
3+
version = "0.7.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

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
//! These types are the public API exposed through the `--output-format json` flag. The [`Crate`]
44
//! struct is the root of the JSON blob and all other items are contained within.
55
6-
use std::collections::{HashMap, HashSet};
6+
use std::collections::HashMap;
77
use std::path::PathBuf;
88

99
use serde::{Deserialize, Serialize};
1010

1111
/// rustdoc format-version.
12-
pub const FORMAT_VERSION: u32 = 10;
12+
pub const FORMAT_VERSION: u32 = 11;
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
@@ -287,29 +287,45 @@ pub enum StructType {
287287
Unit,
288288
}
289289

290-
#[non_exhaustive]
291290
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
292-
#[serde(rename_all = "snake_case")]
293-
pub enum Qualifiers {
294-
Const,
295-
Unsafe,
296-
Async,
291+
pub struct Header {
292+
#[serde(rename = "const")]
293+
pub const_: bool,
294+
#[serde(rename = "unsafe")]
295+
pub unsafe_: bool,
296+
#[serde(rename = "async")]
297+
pub async_: bool,
298+
pub abi: Abi,
299+
}
300+
301+
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
302+
pub enum Abi {
303+
// We only have a concrete listing here for stable ABI's because their are so many
304+
// See rustc_ast_passes::feature_gate::PostExpansionVisitor::check_abi for the list
305+
Rust,
306+
C { unwind: bool },
307+
Cdecl { unwind: bool },
308+
Stdcall { unwind: bool },
309+
Fastcall { unwind: bool },
310+
Aapcs { unwind: bool },
311+
Win64 { unwind: bool },
312+
SysV64 { unwind: bool },
313+
System { unwind: bool },
314+
Other(String),
297315
}
298316

299317
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
300318
pub struct Function {
301319
pub decl: FnDecl,
302320
pub generics: Generics,
303-
pub header: HashSet<Qualifiers>,
304-
pub abi: String,
321+
pub header: Header,
305322
}
306323

307324
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
308325
pub struct Method {
309326
pub decl: FnDecl,
310327
pub generics: Generics,
311-
pub header: HashSet<Qualifiers>,
312-
pub abi: String,
328+
pub header: Header,
313329
pub has_body: bool,
314330
}
315331

@@ -426,8 +442,7 @@ pub enum Type {
426442
pub struct FunctionPointer {
427443
pub decl: FnDecl,
428444
pub generic_params: Vec<GenericParamDef>,
429-
pub header: HashSet<Qualifiers>,
430-
pub abi: String,
445+
pub header: Header,
431446
}
432447

433448
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]

0 commit comments

Comments
 (0)