Commit Graph

3165 Commits

Author SHA1 Message Date
Christian Poveda
bc19e553da remove macro in favor of a method 2022-08-18 18:08:37 +02:00
Christian Poveda
c5995bda24 test warning emission 2022-08-18 18:08:37 +02:00
Christian Poveda
15a720bafa store warnings and emit them later 2022-08-18 18:08:37 +02:00
Amanjeev Sethi
50878f37e6 docs(CONTRIBUTING): add a note for single test run
test-one.sh needs to run `dot` command which is installed via Graphviz.
Else, running the script throws error - `dot` command not found.
2022-08-11 14:36:22 -05:00
Bryn M. Reeves
b18bf798be Add test coverage for 'await' and 'async' keywords
Add declarations for 'await' and 'async' variables to keywords.h
and update the expectations in keywords.rs.
2022-08-09 13:44:30 -05:00
Bryn M. Reeves
4093e870c0 adds 'await' to list of matches in 'rust_mangle' 2022-07-27 17:52:59 +02:00
Emilio Cobos Álvarez
ef2ee38f3a ty: Use canonical type to access pointee.
Using the canonical type fixes this but changes the output of some tests
(in particular, pointer to typedefs now point to the underlying type).
So do this only in known-bad cases.

Fixes #2244
2022-07-25 12:06:38 +02:00
Darren Kulp
105b9422cd Mark update to clap in CHANGELOG 2022-07-21 21:11:18 -04:00
Darren Kulp
dcc78bd279 Update clap and its dependencies
cargo update --package=clap --aggressive
2022-07-21 21:11:18 -04:00
Darren Kulp
87e2e91356 Bump MSRV to 1.57.0 2022-07-18 10:50:15 +02:00
Jim Blandy
ae1ce7d128 Don't use Arg::takes_value when it's implied by other calls.
Both `Arg::value_name` and `Arg::number_of_values` imply
`Arg::takes_value`, so those calls are just noise.
2022-07-16 21:04:46 -04:00
onalante-msft
6df6d0ad99 Add revision suggestion for MSRV >= 1.59.0 2022-07-16 14:33:01 +02:00
onalante-msft
e26230597c Extract pointer once for all alignment tests 2022-07-16 14:33:01 +02:00
onalante-msft
17b01c72ec Regenerate tests targeting libclang 5 2022-07-16 14:33:01 +02:00
onalante-msft
fba40c70e5 Regenerate tests targeting libclang 9 2022-07-16 14:33:01 +02:00
onalante-msft
cb23b471c1 Only insert uninit_decl if check_field_offset is non-empty 2022-07-16 14:33:01 +02:00
onalante-msft
5a4e0d3c7b rustfmt 2022-07-16 14:33:01 +02:00
onalante-msft
df57bd9791 Remove functions, use same uninit for all field tests 2022-07-16 14:33:01 +02:00
onalante-msft
83d0fd56a7 Place field alignment test functions before statements
Clears clippy::items_after_statements warning for tests.
2022-07-16 14:33:01 +02:00
Justin Smith
a1a00434ff Bump msrv to 1.56.1 2022-06-23 16:10:27 +02:00
Danny Mösch
798c056626 Fix link for creduce building/installation 2022-06-23 11:20:20 +02:00
dependabot[bot]
3988fce62f Bump regex from 1.4.6 to 1.5.5
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.6 to 1.5.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.4.6...1.5.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 23:22:02 +02:00
Emilio Cobos Álvarez
9ca5f856a3 Bump version. 2022-06-06 13:22:48 +02:00
Emilio Cobos Álvarez
0e459610d7 Update test expectations. 2022-06-06 13:22:48 +02:00
Emilio Cobos Álvarez
59babdd334 tests: Make some other tests auto-update with BINDGEN_OVERWRITE_EXPECTED=1 2022-06-06 13:22:48 +02:00
Emilio Cobos Álvarez
ae1b386f86 codegen: tests: Put each individual field test in a function.
So that rustc doesn't take too much stack space without optimizations.

Fixes #2218
2022-06-06 13:22:48 +02:00
Emilio Cobos Álvarez
3551811340
v0.60.0
Closes #2209
2022-06-05 20:38:24 +02:00
Emilio Cobos Álvarez
566d2266f6 options: Implement --version manually and print clang version on --version --verbose
Fixes #2138
2022-06-05 20:07:14 +02:00
Darren Kulp
aba2c29fd3 Skip input headers in Linguist statistics
[skip ci]
2022-06-05 19:47:20 +02:00
Darren Kulp
3b99dd5410 Skip generated files in Linguist statistics
[skip ci]
2022-06-05 19:47:20 +02:00
Darren Kulp
11f3b37faf Fix some clippy warnings
cargo clippy --fix --tests
    cargo +nightly fmt
2022-06-05 19:39:25 +02:00
Darren Kulp
24252f0876 Invoke clippy better for tests
See https://github.com/rust-lang/rust-clippy/issues/1436#issuecomment-462059561
2022-06-05 19:39:25 +02:00
Emilio Cobos Álvarez
aa103a6d90
ir: Centralize must_use checks and simplify codegen. 2022-06-05 19:38:05 +02:00
Ian Chamberlain
3a8a60cd4c
Look for must_use on typdefs in function return
Closes #2206
2022-06-05 19:38:05 +02:00
Darren Kulp
2cf7ba9ee1 deps: Update which crate to 4.2.2
Fixes #2181.
2022-06-03 21:48:18 -04:00
Nick Desaulniers
4d18f7606a upgrade clang-sys from 1.2.0 to 1.3.3
Via:
$ cargo update -p clang-sys

Contains a fix that was preventing me from running bindgen in my env.

Link: https://github.com/KyleMayes/clang-sys/issues/138
Link: https://github.com/KyleMayes/clang-sys/pull/142

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2022-05-31 19:31:32 -04:00
Gavin Li
5a01c55199 Fix "dereferencing a null pointer" in C layout tests
Instead of dereferencing a null pointer, create a MaybeUninit from which
we can extract well-defined addresses.
2022-05-17 13:58:45 +02:00
alexdevteam
92487d4ed4 Fix NoneType error 2022-05-08 00:59:44 +02:00
jakobgerhardt
bbffd83f03 provide information how to link to shared objects 2022-05-08 00:59:20 +02:00
David Tolnay
7766ab7166 Update GitHub Actions actions/checkout@v2 to v3
The v2 implementation uses Node 12, which is end-of-life on April 30, 2022.
See https://nodejs.org/en/about/releases/. Update to v3, which is based on
Node 16 whose support lasts until April 30, 2024.
2022-05-08 00:53:12 +02:00
Michal Rostecki
4b085b45f8 Derive from any other trait only when deriving from Copy
It's impossible to #[derive] from any other trait when not deriving from
Copy when using the newest Rust nightly. Any attempt to do that results
in the following error:

  error: `#[derive]` can't be used on a `#[repr(packed)]` struct that does not derive Copy (error E0133)

Fixes: #2083
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2022-05-08 00:52:54 +02:00
Henryk Paluch
ee6ff69229 Fix panic!() argument (quote it) 2022-04-19 21:18:41 +02:00
Alan Wu
841fd4c8dc Use common type alias for anonymous enums in consts mode
Previously, anonymous enums generated a type alias but did not use it.
For example the following:

```C
enum {
    ZERO,
    ONE = 4999,
};
```

Generated this:

```Rust
/* automatically generated by rust-bindgen 0.59.2 */

pub const ZERO: ::std::os::raw::c_uint = 0;
pub const ONE: ::std::os::raw::c_uint = 4999;
pub type _bindgen_ty_1 = ::std::os::raw::c_uint;
```

For use cases where humans look at bindgen's Rust output this was a little
strange since it's a deviation from how the Rust output for named enums
is organized, where all constants share the same type using the type
alias. The unused type alias also triggered the dead_code lint.

Change to use the generated type alias.
2022-04-19 21:18:17 +02:00
Emilio Cobos Álvarez
c27578fac5 codegen: Fix minor clippy warning. 2022-03-15 04:01:13 +01:00
Emil Gardström
9689aecbfe add attributes to dynamic functions
this includes comments and must_use annotations
2022-03-15 04:00:08 +01:00
Emil Gardström
310f7f8770 disable test_clang_env_args on windows 2022-03-15 03:58:40 +01:00
Emil Gardström
26fed0967c disable some tests on windows
This is due to differences in representation of `signed long` and `unsigned long`
on most Linux-based systems and Windows (`64` vs. `32` bits)
2022-03-15 03:58:40 +01:00
Emil Gardström
4a5ae0884d disable layout tests for derive-custom and convert-cpp-comment-to-rust test 2022-03-15 03:58:40 +01:00
Emil Gardström
d90a41ad24 escape \ in paths for tests modules 2022-03-15 03:58:40 +01:00
Darren Kulp
b387d2337d docs: Drop references to Clang 4 2022-03-15 03:54:37 +01:00