594 Commits

Author SHA1 Message Date
David Tolnay
2b8bf6d262
Preserve the original discriminant Expr 2020-05-10 22:57:32 -07:00
David Tolnay
69c7960cb2
Parse negative discriminants 2020-05-10 22:57:32 -07:00
David Tolnay
17e137fbb3
Factor out a discriminant processing library 2020-05-10 22:57:32 -07:00
David Tolnay
699351bc78
Display for Atom 2020-05-10 22:57:08 -07:00
David Tolnay
a4596c4455
Expose Atom str for use in error messages 2020-05-10 22:55:45 -07:00
David Tolnay
64703b4207
Give Derive enum and impls their own module 2020-05-10 22:12:33 -07:00
David Tolnay
c0fad20670
Add crates.io categories and keywords 2020-05-10 20:16:28 -07:00
David Tolnay
3e62888960
Keep items that have attr parse errors 2020-05-10 15:36:01 -07:00
David Tolnay
b129ea7163
Organize how the caller determines which attrs to parse
In preparation for parsing even more attributes, such as `repr`.
2020-05-10 14:48:30 -07:00
David Tolnay
e86b9cf225
Update derive parsing to produce structured representation 2020-05-10 14:26:04 -07:00
David Tolnay
6cadf70b58
Merge pull request #194 from philipcraig/std_c++11_not_required_on_msvc
avoid MSVC warning via flag_if_supported
2020-05-09 12:06:54 -07:00
Philip Craig
7e14e2e6cb
avoid MSVC warning via flag_if_supported 2020-05-09 12:00:49 -07:00
David Tolnay
32439dae38
Apply PR 193 to rustdoc as well 2020-05-09 09:59:40 -07:00
David Tolnay
55f4949549
Merge pull request #193 from philipcraig/fix_readme
fix path to c++ generator example
2020-05-09 09:56:08 -07:00
Philip Craig
064668a00f fix path to c++ generator example 2020-05-09 08:24:12 +01:00
David Tolnay
e2f70fea3e
Release 0.3.2 0.3.2 2020-05-08 15:57:14 -07:00
David Tolnay
887c8a2eb1
Merge pull request #192 from cchalmers/cpp-true
Add cpp flag to cc
2020-05-08 15:55:10 -07:00
David Tolnay
110df7dc21
Defer to link-cplusplus crate for linking a standard library 2020-05-08 13:09:56 -07:00
David Tolnay
96c351b5a8
Format with rustfmt 2020-04-14 2020-05-08 13:06:18 -07:00
Christopher Chalmers
d24563dd24 Add cpp flag to cc
This means that clang++ will be called instead of clang.
2020-05-08 20:39:10 +01:00
David Tolnay
878ab12a15
Release 0.3.1 0.3.1 2020-05-08 10:05:03 -07:00
David Tolnay
2429c6b0f6
Merge pull request #190 from dtolnay/id
Enable sharing a consistent Rust type across multiple FFI blocks
2020-05-08 02:36:06 -07:00
David Tolnay
ae4dedab55
Update build files of test suite 2020-05-08 02:23:10 -07:00
David Tolnay
094db3ecea
Document ExternType trait 2020-05-08 02:06:30 -07:00
David Tolnay
a62cca2268
Add a use of type alias to test suite 2020-05-07 23:20:06 -07:00
David Tolnay
2b821e60e0
Don't do trait impls for non-local types 2020-05-07 23:18:09 -07:00
David Tolnay
e5a015a2b4
Allow type alias as a method receiver 2020-05-07 21:54:31 -07:00
David Tolnay
83fe0f06d5
Preserve a better span for type id mismatch errors 2020-05-07 20:14:49 -07:00
David Tolnay
c6ba2d27f4
Condense type ids rendered by rustc 2020-05-07 19:46:02 -07:00
David Tolnay
9f07303af1
Add ui test of type_id mismatch 2020-05-07 19:46:02 -07:00
David Tolnay
5f9e8ca1a0
Type alias code generation 2020-05-07 19:46:02 -07:00
David Tolnay
379d342779
Type alias type info 2020-05-07 19:46:02 -07:00
David Tolnay
3118fa6606
Type alias ident checking 2020-05-07 19:46:02 -07:00
David Tolnay
e2f9ec4c89
Type alias parsing 2020-05-07 19:46:02 -07:00
David Tolnay
e47119ca2f
Pull in syn 1.0.19
Includes https://github.com/dtolnay/syn/pull/790 which we need for
extern type aliases.
2020-05-07 19:46:02 -07:00
David Tolnay
9938381aa7
Introduce type aliases in syntax tree 2020-05-07 19:46:02 -07:00
David Tolnay
d09e012608
Add a type-level encoding of qualified paths 2020-05-07 19:46:01 -07:00
David Tolnay
db08d4affe
Pull in quote 1.0.4
Includes https://github.com/dtolnay/quote/pull/151 which will be used in
the implementation of type_id.
2020-05-07 19:46:01 -07:00
David Tolnay
6e80833572
Support code generation for multiple cxx::bridge files in one Build 2020-05-07 19:44:11 -07:00
David Tolnay
295ef6b38a
Adjust foreign item parsing to prepare for type aliases
This will be required for parse_extern_type to return a different kind
of Api for the case of type aliases.
2020-05-07 16:10:30 -07:00
David Tolnay
29061ea1d8
Update build status badge to GitHub Actions 2020-05-05 13:56:54 -07:00
David Tolnay
9531334f5a
Move github funding.yml out of repo root 2020-05-05 12:54:15 -07:00
David Tolnay
dfbce4bbc5
Remove unreachable return case from cxx function shim
This is unreachable because returning a CxxVector by value is not
allowed.

    error[cxxbridge]: returning C++ vector by value is not supported
       ┌─ lib.rs:30:29
       │
    30 │     fn not_allowed() -> CxxVector<u8>;
       │                         ^^^^^^^^^^^^^ returning C++ vector by value is not supported
       │
2020-05-05 10:52:12 -07:00
David Tolnay
4301f3ca51
Simplify discriminant overflow check 2020-05-05 10:29:52 -07:00
David Tolnay
a3f6407efa
Expand discriminant overflow error message
Renders as:

    error[cxxbridge]: discriminant overflow on value after 4294967295
       ┌─ src/main.rs:11:9
       │
    11 │         B,
       │         ^ discriminant overflow
       │
       = note: explicitly set `= 0` if that is desired outcome

This more closely matches rustc's error message, which is:

    error[E0370]: enum discriminant overflowed
     --> src/lib.rs:4:5
      |
    4 |     B,
      |     ^ overflowed on value after 255
      |
      = note: explicitly set `B = 0` if that is desired outcome
2020-05-05 10:28:00 -07:00
David Tolnay
884d91f0bc
Resolve absurd_extreme_comparisons lint 2020-05-05 10:17:23 -07:00
David Tolnay
db450b0a9d
Suppress some lints in cxx-build 2020-05-05 10:16:57 -07:00
David Tolnay
c79ba750b0
Suppress len_without_is_empty lint 2020-05-05 10:13:00 -07:00
David Tolnay
39ee0ed36b
Resolve assign_op_pattern lint 2020-05-05 10:12:29 -07:00
David Tolnay
7ae018fb5a
Resolve redundant_field_names lint 2020-05-05 10:11:30 -07:00