Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.28 #1042

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# unreleased

# 0.28.0

* Parse unsafe attributes in https://github.com/mozilla/cbindgen/pull/1020
* Fix local override of enum prefix-with-name by jsgf in https://github.com/mozilla/cbindgen/pull/1006
* Add rename-all=prefix in https://github.com/mozilla/cbindgen/pull/1021
* ir: add support for UnsafeCell and SyncUnsafeCell by alekitto in https://github.com/mozilla/cbindgen/pull/1003
* Implement mangling for arrays in https://github.com/mozilla/cbindgen/pull/1022
* Fix: Ignore `CARGO_BUILD_TARGET` in tests by bryango in https://github.com/mozilla/cbindgen/pull/1010
* Newline for each field for constexpr field constants by youknowone in https://github.com/mozilla/cbindgen/pull/988
* Fix clippy warnings by youknowone in https://github.com/mozilla/cbindgen/pull/1026
* Add aarch64/arm64 to CI by NickeZ in https://github.com/mozilla/cbindgen/pull/1036
* Add `unstable_ir` feature flag that makes the ir pub by heesooy in https://github.com/mozilla/cbindgen/pull/1011
* Support generated a symbols file by TheElectronWill in https://github.com/mozilla/cbindgen/pull/916

# 0.27.0

* Revert: The `Config` struct now has a private member.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cbindgen"
version = "0.27.0"
version = "0.28.0"
authors = [
"Emilio Cobos Álvarez <[email protected]>",
"Jeff Muizelaar <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions src/bindgen/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ impl Bindings {
std::fs::create_dir_all(dir).unwrap();
}
let mut writer = BufWriter::new(File::create(symfile_path).unwrap());
write!(&mut writer, "{{\n").expect("writing symbol file header failed");
writeln!(&mut writer, "{{").expect("writing symbol file header failed");
for symbol in self.dynamic_symbols_names() {
write!(&mut writer, "{};\n", symbol).expect("writing symbol failed");
writeln!(&mut writer, "{};", symbol).expect("writing symbol failed");
}
write!(&mut writer, "}};").expect("writing symbol file footer failed");
}
Expand Down
3 changes: 1 addition & 2 deletions src/bindgen/cdecl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ impl CDecl {

#[allow(clippy::while_let_on_iterator)]
while let Some(declarator) = iter_rev.next() {
let next_is_pointer = iter_rev.peek().map_or(false, |x| x.is_ptr());

let next_is_pointer = iter_rev.peek().is_some_and(|x| x.is_ptr());
match *declarator {
CDeclarator::Ptr {
is_const,
Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/ir/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ impl Constant {
return;
}

let associated_to_transparent = associated_to_struct.map_or(false, |s| s.is_transparent);
let associated_to_transparent = associated_to_struct.is_some_and(|s| s.is_transparent);

let in_body = associated_to_struct.is_some()
&& config.language == Language::Cxx
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations-symbols/abi_string.c.sym
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
c;
c_unwind;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/alias.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/annotation.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/array.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/asserted_cast.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
foo;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/assoc_constant.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/associated_in_body.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/bitfield.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/bitflags.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/body.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/box.c.sym
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
root;
drop_box;
drop_box_opt;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/cdecl.c.sym
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
O;
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/cell.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
6 changes: 5 additions & 1 deletion tests/expectations-symbols/cfg.c.sym
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
root;
root;
cond;
};
foo;
bar;
global_array_with_different_sizes;
global_array_with_different_sizes;
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/cfg_2.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/char.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/const_generics.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/const_generics_arrayvec.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
push;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/const_generics_bool.c.sym
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ new_set;
set_for_each;
new_map;
map_for_each;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/const_generics_byte.c.sym
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
init_parens_parser;
destroy_parens_parser;
init_braces_parser;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/const_generics_char.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
until_nul;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/const_generics_constant.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/const_generics_thru.c.sym
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
one;
two;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/constant.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/constant_sort_name.c.sym
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
C;
D;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/constant_sort_none.c.sym
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
D;
C;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/custom_header.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/decl_name_conflicting.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/dep_v2.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
get_x;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/deprecated.c.sym
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ deprecated_with_note;
deprecated_with_note_and_since;
deprecated_with_note_which_requires_to_be_escaped;
dummy;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/derive_eq.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/derive_ostream.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/destructor_and_copy_ctor.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/display_list.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
push_item;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/doclength_short.c.sym
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
root;
trunk;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/docstyle_auto.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/docstyle_c99.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/docstyle_doxy.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
3 changes: 2 additions & 1 deletion tests/expectations-symbols/documentation.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
root;
};
FOO;
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/documentation_attr.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/enum.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/enum_discriminant.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/enum_self.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/euclid.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/exclude_generic_monomorph.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/expand.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/expand_default_features.c.sym
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
extra_debug_fn;
root;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/expand_dep.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
get_x;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/expand_dep_v2.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
get_x;
};
};
2 changes: 1 addition & 1 deletion tests/expectations-symbols/expand_features.c.sym
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
extra_debug_fn;
cbindgen;
root;
};
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
root;
};
};
3 changes: 2 additions & 1 deletion tests/expectations-symbols/export_name.c.sym
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
do_the_thing_with_export_name;
};
do_the_thing_with_unsafe_export_name;
};
Loading