Skip to content

Commit 3d9b4a3

Browse files
committed
Update rustdoc-types to be compatible again
1 parent 5e96ecf commit 3d9b4a3

File tree

7 files changed

+27
-29
lines changed

7 files changed

+27
-29
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- uses: dtolnay/rust-toolchain@1.82.0
15+
- uses: dtolnay/rust-toolchain@1.83.0
1616
with:
1717
components: clippy, rustfmt
1818
- name: Set environment variables
@@ -29,6 +29,6 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: dtolnay/rust-toolchain@1.82.0
32+
- uses: dtolnay/rust-toolchain@1.83.0
3333
- name: Run test
3434
run: cargo test -p tests

Cargo.lock

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buffi/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "buffi"
33
description = "A tool to generate ergonomic, buffer-based C++ APIs."
4-
version = "0.2.2+rust.1.82.0"
4+
version = "0.2.3+rust.1.83.0"
55
edition = "2021"
66
license = "MIT OR Apache-2.0"
77
documentation = "https://docs.rs/buffi"
@@ -13,7 +13,6 @@ readme = "../README.md"
1313
[dependencies]
1414
serde = { version = "1.0.213", features = ["derive"] }
1515
serde_json = "1.0.132"
16-
toml = "0.8.19"
1716
serde-generate = { version = "0.26.0", default-features = false, features = ["cpp"] }
1817
serde-reflection = "0.4.0"
19-
rustdoc-types = "0.27.0"
18+
rustdoc-types = "0.32.2"

buffi/src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl ItemResolver {
137137
.find(|(_, i)| i.path == parts)
138138
.expect("It's there");
139139
if summary.kind == requested_item {
140-
id.clone()
140+
*id
141141
} else {
142142
panic!(
143143
"Incompatible type: Expected {requested_item:?}, Got {:?}",
@@ -179,7 +179,7 @@ impl ItemResolver {
179179
.iter()
180180
.find(|i| extract_crate_from_span(i) == parent_crate);
181181
match matches_parent_crate {
182-
Some(t) if id.0.starts_with('0') => {
182+
Some(t) if id.0 == 0 => {
183183
return rustdoc_types::Item::clone(t);
184184
}
185185
_ => {
@@ -587,7 +587,7 @@ fn generate_function_def(
587587
config: &Config,
588588
impl_type: Option<&rustdoc_types::Type>,
589589
) {
590-
let output_type = if let Some(ref tpe) = m.decl.output {
590+
let output_type = if let Some(ref tpe) = m.sig.output {
591591
let tpe = to_serde_reflect_type(
592592
tpe,
593593
res,
@@ -602,7 +602,7 @@ fn generate_function_def(
602602
unimplemented!()
603603
};
604604
let inputs = m
605-
.decl
605+
.sig
606606
.inputs
607607
.iter()
608608
.map(|(name, tpe)| {
@@ -633,7 +633,7 @@ fn generate_function_def(
633633
(name, type_string)
634634
})
635635
.collect::<Vec<_>>();
636-
let return_output_type = match m.decl.output {
636+
let return_output_type = match m.sig.output {
637637
Some(rustdoc_types::Type::ResolvedPath(ref p))
638638
if get_name_without_path(&p.name) == "Result" =>
639639
{
@@ -737,7 +737,7 @@ fn generate_function_def(
737737
)
738738
.unwrap();
739739
writeln!(out_functions).unwrap();
740-
if matches!(m.decl.output, Some(rustdoc_types::Type::ResolvedPath(ref p)) if get_name_without_path(&p.name) == "Result")
740+
if matches!(m.sig.output, Some(rustdoc_types::Type::ResolvedPath(ref p)) if get_name_without_path(&p.name) == "Result")
741741
{
742742
writeln!(
743743
out_functions,
@@ -802,12 +802,12 @@ fn generate_type_definitions(
802802
})
803803
.flat_map(|m| {
804804
if let rustdoc_types::ItemEnum::Function(ref m) = m.inner {
805-
m.decl
805+
m.sig
806806
.inputs
807807
.iter()
808808
.map(|(_, t)| t.clone())
809809
.chain(
810-
m.decl
810+
m.sig
811811
.output
812812
.as_ref()
813813
.map(|e| vec![e.clone()])
@@ -1028,7 +1028,7 @@ fn to_serde_reflect_type(
10281028
}) {
10291029
let t = rustdoc_types::Type::ResolvedPath(rustdoc_types::Path {
10301030
name: "SerializableError".into(),
1031-
id: id.clone(),
1031+
id: *id,
10321032
args: None,
10331033
});
10341034
to_serde_reflect_type(
@@ -1604,10 +1604,10 @@ fn generate_exported_struct(
16041604
if let rustdoc_types::ItemEnum::StructField(ref tpe) = s.inner {
16051605
let parent_args = if let Some(rustdoc_types::GenericArgs::AngleBracketed {
16061606
args,
1607-
bindings,
1607+
constraints,
16081608
}) = p.args.as_deref()
16091609
{
1610-
if args.is_empty() && bindings.is_empty() {
1610+
if args.is_empty() && constraints.is_empty() {
16111611
Vec::new()
16121612
} else if parent_args.len() == 1
16131613
&& args.len() == 1
@@ -1706,8 +1706,8 @@ fn to_c_type(tpe: &rustdoc_types::Type) -> String {
17061706
rustdoc_types::Type::Array { .. } => unimplemented!(),
17071707
rustdoc_types::Type::ImplTrait(_) => unimplemented!(),
17081708
rustdoc_types::Type::Infer => unimplemented!(),
1709-
rustdoc_types::Type::RawPointer { mutable, type_ } => {
1710-
let mut out = if *mutable {
1709+
rustdoc_types::Type::RawPointer { is_mutable, type_ } => {
1710+
let mut out = if *is_mutable {
17111711
String::new()
17121712
} else {
17131713
String::from("const ")
@@ -1726,7 +1726,7 @@ fn generate_extern_c_function_def(name: &str, func: &rustdoc_types::Function) ->
17261726
write!(
17271727
out,
17281728
"{} ",
1729-
func.decl
1729+
func.sig
17301730
.output
17311731
.as_ref()
17321732
.map(to_c_type)
@@ -1735,7 +1735,7 @@ fn generate_extern_c_function_def(name: &str, func: &rustdoc_types::Function) ->
17351735
.unwrap();
17361736

17371737
let args = func
1738-
.decl
1738+
.sig
17391739
.inputs
17401740
.iter()
17411741
.map(|(name, tpe)| {

buffi_macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "buffi_macro"
33
description = "A proc-macro to generate ergonomic, buffer-based C++ APIs."
4-
version = "0.2.2"
4+
version = "0.2.3"
55
edition = "2021"
66
license = "MIT OR Apache-2.0"
77
documentation = "https://docs.rs/buffi_macro"

example/buffi_example/rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.82.0
1+
1.83.0

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.82.0"
2+
channel = "1.83.0"
33
components = ["rustfmt", "clippy"]
44
profile = "minimal"

0 commit comments

Comments
 (0)