1083 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2e1be24167 ir: Give integers a more structured representation. 2021-01-14 23:39:59 +01:00
Emilio Cobos Álvarez
b9cfb34d29
Reintroduce clippy checks (#643) 2021-01-14 19:41:13 +01:00
Philipp Kaiser
ee01884d90 [#644] Add parse extra bindings to builder 2021-01-08 16:49:24 +01:00
Luni-4
428ae2c6c9 Add a comment to explain release notes code 2021-01-04 18:39:35 +01:00
Luni-4
3a352e92a5 Fix clippy warnings 2021-01-04 17:43:12 +01:00
Luni-4
5698270518 ci: reintroduce clippy checks 2021-01-04 17:31:46 +01:00
Emilio Cobos Álvarez
4e578fb2da
Fix typo in config option.
Fixes #641.
2021-01-04 15:41:50 +01:00
Luni-4
35afe47d0d Format release notes in a better way 2021-01-04 15:40:56 +01:00
Arnaud
14d1404455 Remove the 'TODO' and the #[allow(clippy::ptr_arg)] attribute 2021-01-04 15:34:48 +01:00
Arnaud
ab7b0409bf Replace &String with &str in Parser::should_parse_dependency's arguments
As the TODO suggested, this involves replacing some calls to `contains()`
with `iter().any()`
2021-01-04 15:34:48 +01:00
Emilio Cobos Álvarez
30c642cac4 Test that cargo test in cargo package dir succeeds. 2020-12-26 18:45:35 +01:00
Emilio Cobos Álvarez
59f7b63280 Skip profiles test in package.
See https://github.com/rust-lang/cargo/issues/9017

Fixes #637.
2020-12-26 18:45:35 +01:00
Emilio Cobos Álvarez
1264d4c054
Minor metadata updates, rewrap README. 2020-12-21 00:24:24 +01:00
Emilio Cobos Álvarez
a00b4215a9
v0.16.0
* Remove artificial restriction on lifetime parameters on enums (#604)
 * Add an option for converting usize/isize into size_t/ptrdiff_t. (#606)
 * Allow controlling the cargo profile used for expansion. (#607)
 * Support wider range of expressions in enum discriminants (#614)
 * Support generation of Cython bindings (#590)
 * Fixed some issues with style=tag and recursive structs (#615)
 * Default C style to Both (as specified in docs) (#615)
 * Fix resolution of path dependencies from certain modules. (#629)
 * Support inlined definitions for tuple variants with a single field in C (#631)

Thanks to all the awesome contributors that contributed to this release.
2020-12-21 00:07:32 +01:00
Vadim Petrochenkov
b82e375254 enum: Support inlined definitions for tuple variants with a single field 2020-12-09 19:38:21 +01:00
Vadim Petrochenkov
eaf3e57e74 enum: Remove some redundant function parameters 2020-12-09 19:38:21 +01:00
Vadim Petrochenkov
0083c43e13 Remove Struct::tuple_struct
It was used for adding `_` to names of numeric fields, but with inlined variants it isn't correct, so now we add `_` only if the field actually starts with a non-identifier character (a digit).
2020-12-09 19:38:21 +01:00
Vadim Petrochenkov
8a5db0baeb Minor cleanup to fn close_brace 2020-12-09 19:38:21 +01:00
Yurii Rashkovskii
1963f0c92e Partially support #[cfg]s on fields 2020-12-06 13:10:15 +01:00
Vadim Petrochenkov
dfcee869ba enum: Do not forget to rename entities in enum discriminants 2020-12-06 01:53:09 +01:00
Emilio Cobos Álvarez
fbc2237b7d parser: Fix resolution of #[path] dependencies from certain modules.
We need the current mod dir to resolve #[path], not the one we get for
rust 2018.

Fixes #599
2020-11-30 19:44:45 +01:00
Vadim Petrochenkov
9f558e30f3 enum: enum_name -> tag_name 2020-11-30 11:59:02 +01:00
Vadim Petrochenkov
8997277cb7 enum: Break up Enum::write into multiple functions 2020-11-30 11:59:02 +01:00
Vadim Petrochenkov
f564c6a5f4 enum: Add some comments to enum writer 2020-11-30 11:59:02 +01:00
Vadim Petrochenkov
5bef63630f enum/struct: Avoid some ambiguous naming 2020-11-30 11:59:02 +01:00
Vadim Petrochenkov
3d6717c5bc enum: Move generation of derived functions into a separate method 2020-11-30 11:59:02 +01:00
Vadim Petrochenkov
7980288a94 Reenable some tests 2020-11-27 01:31:01 +01:00
Vadim Petrochenkov
98b7a3f9b9 cython: Leave out values of constants and enumerators
Keep them as documentation only
2020-11-27 01:31:01 +01:00
Vadim Petrochenkov
1b7976c88e ci: Check cargo test with minimim supported Rust version 2020-11-26 13:40:36 +01:00
Jordan Rose
198157b53f tests: Provide a fallback for CARGO_BIN_EXE_ for earlier Rusts 2020-11-26 11:04:20 +01:00
Vadim Petrochenkov
50fe950c40 cython: Fix a non-reproducible test 2020-11-26 11:02:28 +01:00
Vadim Petrochenkov
313827941d cython: Add comments about unsupported conditional enum variants 2020-11-26 11:02:28 +01:00
Wodann
68a1e65875
fix: default style to Both (as specified in docs)
Closes #615.
Closes #215.

Possibly closes others.
2020-11-25 18:04:30 +01:00
Wodann
5b5b46b7d6
fix: resolve path types for 'both' style 2020-11-25 17:55:58 +01:00
Emilio Cobos Álvarez
85a2f4c956
tests: Remove unneeded test file. 2020-11-25 17:50:38 +01:00
Vadim Petrochenkov
b0aae44c77 Add two Cython-specific options to the config 2020-11-25 17:33:38 +01:00
Vadim Petrochenkov
1c1d4754ce tests: Remove Cython-specific configs 2020-11-25 17:30:30 +01:00
Vadim Petrochenkov
51405d1277 Support generation of Cython bindings 2020-11-17 15:27:34 +01:00
Vadim Petrochenkov
a689bcabc7
Support an annotation for generating bitfield sizes in C code (: SIZE)
Closes #609
Closes #611
2020-10-31 17:05:49 +01:00
Vadim Petrochenkov
dc12952e19
Keep annotations on fields 2020-10-31 17:05:37 +01:00
Vadim Petrochenkov
62e51b5e33
Factor out Field into a separate structure 2020-10-31 17:05:37 +01:00
Vadim Petrochenkov
a93034c229 test suite: Normalize dashes to underscores in test names 2020-10-31 17:01:44 +01:00
Vadim Petrochenkov
14913650e1 Clarify some logic around cpp_compat and tagged unions 2020-10-31 17:00:57 +01:00
Vadim Petrochenkov
94e9b3111f Use a getter for accessing Config::cpp_compat 2020-10-31 17:00:57 +01:00
Vadim Petrochenkov
b69a9cfe80 Support wider range of expressions in enum discriminants 2020-10-31 16:58:37 +01:00
Emilio Cobos Álvarez
ef05231b5c
cargo: Remove duplicate Profile enum.
use the one from the configuration instead.
2020-10-27 11:39:12 +01:00
Jordan Rose
0ba241498e
Allow controlling the Cargo profile used for macro expansion
If there's already a release build, it's better for cbindgen to reuse
the build artifacts from that to expand macros rather than starting
from scratch with a debug build. Controlled with

  --profile (debug|release)

as well as parse.expand.profile in cbindgen.toml, though hardcoding a
profile in a config file seems unlikely.
2020-10-27 11:35:10 +01:00
Vadim Petrochenkov
398b28ca30 Add an option for converting usize/isize into size_t/ptrdiff_t 2020-10-27 11:34:27 +01:00
Vadim Petrochenkov
050863a249 test suite: Remove existing duplicate expectation files 2020-10-20 22:59:14 +02:00
Vadim Petrochenkov
3a7e24d2d7 test suite: Do not generate identical expectation files 2020-10-20 22:59:14 +02:00