Commit Graph

435 Commits

Author SHA1 Message Date
David Tolnay
392fbc6669
Add test of unsorted nested structs 2020-11-03 18:14:17 -08:00
David Tolnay
701c688476
Add repro of shared string by reference error 2020-11-02 18:20:08 -08:00
David Tolnay
7907966838
Switch to namespace = "quoted::path" in docs and tests
To preserve parity with item-level #[namespace = "..."] which is
currently restricted by rustc to a quoted string.
2020-11-01 09:12:05 -08:00
David Tolnay
ace45fa942
Re-enable c_take_callback test 2020-10-31 23:38:49 -07:00
David Tolnay
0aa9c773a1
Merge pull request #392 from adetaylor/namespace-forward-declarations
Namespace forward declarations
2020-10-31 22:39:47 -07:00
Adrian Taylor
9238b706a8 Test for namespace order sensitivity. 2020-10-31 22:15:24 -07:00
David Tolnay
0356d33acb
Pass Str in PtrLen representation
MSVC is hesitant about passing private fields in an extern "C" signature.
Repro:

    struct Str1 {
      const char *ptr;
      size_t len;
    };

    struct Str2 {
    private:
      const char *ptr;
      size_t len;
    };

    extern "C" {
      Str1 str1();
      Str2 str2();
    }

Warning from MSVC v19.27:

    warning C4190: 'str2' has C-linkage specified, but returns UDT 'Str2' which is incompatible with C
2020-10-31 20:33:39 -07:00
David Tolnay
5df1f06eb8
Eliminate Str::Repr struct 2020-10-31 17:31:44 -07:00
David Tolnay
bf23e3e185
Format PR 370 with clang-format 2020-10-30 21:12:50 -07:00
Adrian Taylor
0447e96b84 Revert to older error string. 2020-10-29 21:22:24 -07:00
Adrian Taylor
f2d9d86c3d Simplify test suite. 2020-10-29 21:21:30 -07:00
Adrian Taylor
3e5cff4a3d Switch to #[namespace = A::B] syntax.
Thanks to sbrocket for this parsing code.
2020-10-29 19:48:45 -07:00
Adrian Taylor
c871343ac2 Allow namespace override.
This change allows a

 #[namespace (namespace = A::B)]

attribute for each item in a cxx::bridge.

We now have a fair number of different types of name floating
around:
* C++ identifiers
* C++ fully-qualified names
* Rust identifiers
* Rust fully-qualified names (future, when we support sub-modules)
* Items with both a Rust and C++ name (a 'Pair')
* Types with only a known Rust name, which can be resolved to a
  C++ name.

This change attempts to put some sensible names for all these
things in syntax/mod.rs, and so that would be a good place to start
review.

At the moment, the Namespace (included in each CppName)
is ruthlessly cloned all over the place. As a given namespace is
likely to be applicable to many types and functions, it may
save significant memory in future to use Rc<> here. But let's not
optimise too early.
2020-10-26 15:23:34 -07:00
Adrian Taylor
0fac321939 Adding tests for method calls in foreign namespaces 2020-10-26 15:17:02 -07:00
Adrian Taylor
ddc146ef9f Adding tests for functions in other namespaces. 2020-10-26 15:17:02 -07:00
Adrian Taylor
d47af7a9d3 Tests for opaque C types in namepsaces 2020-10-26 15:17:02 -07:00
Adrian Taylor
585bb0bc56 Tests for namespaced extern trivial types 2020-10-26 15:17:02 -07:00
Adrian Taylor
5e79c64769 Tests for namespaced opaque extern types. 2020-10-26 15:17:02 -07:00
Adrian Taylor
9a158e408f Adding tests for types in namespaces. 2020-10-26 15:17:02 -07:00
David Tolnay
743caa283c
Remove duplicated UniquePtr<C> impl in ui test 2020-10-16 13:22:47 -07:00
David Tolnay
441956e803
Match layout of C++ tests::E and struct E in Rust 2020-10-16 13:21:51 -07:00
David Tolnay
ca0f9da832
Format PR 361 with rustfmt 2020-10-16 13:18:54 -07:00
Adrian Taylor
9f7ff2e3a6 Switch to build-time squashing of 'new' method. 2020-10-12 20:14:17 -07:00
Adrian Taylor
117d3baac7 Bazel/Buck test build fixups.
Sacrifices to satisfy the PR builder guardians.
2020-10-12 16:33:30 -07:00
Adrian Taylor
d75f7e2911 Allow creation of UniquePtrs to trivial aliased types. 2020-10-12 16:16:19 -07:00
David Tolnay
362c9f92b0
Touch up PR 356 2020-10-10 16:30:04 -07:00
Adrian Taylor
1931ccf65e Attempt at BUCK and BUILD files. 2020-10-10 16:19:20 -07:00
Adrian Taylor
121cca4a06 Add tests for ExternType. 2020-10-10 16:01:26 -07:00
David Tolnay
3bbcdbbbf6
Add test of cxx_/rust_name attributes 2020-10-09 20:22:23 -07:00
David Tolnay
8f16ae75f3
Bump namespace to 05 2020-10-08 19:34:50 -07:00
David Tolnay
d41eef59c9
Change test suite's include_prefix to match workspace path 2020-10-08 16:57:55 -07:00
David Tolnay
1f7a7e5bca
Touch up cxx_gen test 2020-10-04 19:50:35 -07:00
David Tolnay
821402b2a6
Move C++ generated code test to cxx's integration test 2020-10-04 19:50:35 -07:00
David Tolnay
0531f43ce9
Improve error message on a conflicting explicit impl 2020-10-04 00:36:56 -07:00
David Tolnay
64cab48688
Add ui test of explicit impl trait for type 2020-10-04 00:20:22 -07:00
David Tolnay
2b3c2b2fa4
Add ui test of invalid nonempty impl block 2020-10-04 00:20:22 -07:00
David Tolnay
50b7563de4
Add ui test of explicit impl with unsupported Self 2020-10-04 00:20:22 -07:00
David Tolnay
ac8394bd18
Add test of UniquePtrTarget impl conflict 2020-10-04 00:20:21 -07:00
David Tolnay
3208fd7a58
Provide more helpful error when opaque C++ type used by value 2020-10-03 21:10:05 -07:00
David Tolnay
9f69230783
Merge pull request #325 from adetaylor/with-trivial-2
Allow type aliases to be marked as Trivial.
2020-10-03 20:53:30 -07:00
Adrian Taylor
feb0dc104c Fix expected error messages. 2020-09-30 16:51:31 -07:00
David Tolnay
e53ec04397
Bypass compiletest on Windows push and pull_request builds 2020-09-24 23:36:00 -04:00
David Tolnay
80631e93ef
Add test involving empty vector 2020-09-24 16:07:30 -04:00
David Tolnay
5df0a71dcf
Add test for CxxVector::as_slice 2020-09-24 15:58:58 -04:00
David Tolnay
717c7e6aa8
Factor out genrules to rust_cxx_bridge.bzl 2020-09-24 10:08:10 -04:00
David Tolnay
dc57990e22
Use more systematic naming for generated code targets 2020-09-24 10:00:50 -04:00
David Tolnay
0cd342913a
Make buck/bazel generated filepaths match source path with extension 2020-09-24 09:40:27 -04:00
David Tolnay
55151b4575
Match bazel's semantics for genrule cmd 2020-09-24 09:40:27 -04:00
David Tolnay
e02c8b3b98
Load cc_library from @rules_cc
Buildifier warns about this now.

    Function "cc_library" is not global anymore and needs to be loaded
    from "@rules_cc//cc:defs.bzl".buildifier(native-cc)
2020-09-24 08:58:09 -04:00
David Tolnay
e4d30f2257
Set test size of //tests:test Bazel test
Without this:

    INFO: Analyzed 33 targets (1 packages loaded, 12 targets configured).
    INFO: Found 32 targets and 1 test target...
    INFO: Elapsed time: 0.905s, Critical Path: 0.66s
    INFO: 3 processes: 3 linux-sandbox.
    INFO: Build completed successfully, 3 total actions
    //tests:test                                                             PASSED in 0.1s
      WARNING: //tests:test: Test execution time (0.1s excluding execution overhead) outside of range for MODERATE tests. Consider setting timeout="short" or size="small".
2020-09-24 08:57:22 -04:00
David Tolnay
22602b43a8
Fix return Result<Box<T>> from Rust to C++ 2020-09-21 18:22:37 -04:00
David Tolnay
d7fef0a162
Update ui tests to nightly-2020-09-05 2020-09-04 23:28:56 -07:00
David Tolnay
25db1555f5
Update import path scheme for tests 2020-09-01 22:41:15 -07:00
David Tolnay
7273963a61
Sort buck genrule args the way buildifier wants
https://github.com/bazelbuild/buildtools/tree/master/buildifier
2020-09-01 20:48:11 -07:00
David Tolnay
5e668bce9b
Format ui test files using rustfmt 2020-08-29 11:36:22 -07:00
David Tolnay
de1cb777b2
Specify consistent c++ standard between cxx and cxx-test-suite 2020-08-28 17:36:33 -07:00
David Tolnay
47e239df11
Implement CxxVector<CxxString> 2020-08-28 00:43:10 -07:00
David Tolnay
33f56ad8d5
Implement Vec<String> 2020-08-28 00:25:41 -07:00
David Tolnay
18d93b6d58
Add &mut tests 2020-08-27 01:00:18 -07:00
David Tolnay
a7ba6a629c
Format with rustfmt 1.4.20 2020-08-27 00:15:55 -07:00
David Tolnay
b10c4bc33a
Format with clang-format 10 2020-08-26 22:13:31 -07:00
David Tolnay
8e1e6ac25c
Extend exception message from Vec<T>::at 2020-08-26 22:13:31 -07:00
David Tolnay
61adf428be
Add test for Vec<T>::at exception message 2020-08-26 22:13:31 -07:00
David Tolnay
fb8ddd8eb3
Merge pull request #257 from rinon/rust_vec_accessors
Add rust::Vec accessors
2020-08-26 21:49:23 -07:00
David Tolnay
c8361027d9
Remove dependency of ui test on whether rust-src is installed 2020-08-25 22:03:00 -07:00
David Tolnay
691dc171b5
Update ui tests with rust-src component installed 2020-08-25 19:56:12 -07:00
David Tolnay
a08b19f5b1
Add include required for back_inserter
See failure in https://github.com/dtolnay/cxx/issues/260.
2020-08-25 19:21:16 -07:00
Stephen Crane
9e48d5b5c6 Add rust::Vec accessors
Adds operator[], at(), front(), and back() to rust::Vec.
2020-08-21 12:17:02 -07:00
David Tolnay
291a8b87a1
Update to trybuild 1.0.32 2020-08-09 16:46:45 -07:00
David Tolnay
6911d6d604
Update ui tests to nightly-2020-07-15 2020-07-21 18:05:48 -07:00
David Tolnay
0067236217
Update ui tests to nightly-2020-07-07 2020-07-21 18:02:36 -07:00
David Tolnay
b3d5e600a7
Update ui tests to nightly-2020-06-27 2020-07-21 17:58:14 -07:00
David Tolnay
0c8c0f26fa
Unbreak ui test on c_take_callback warning 2020-07-21 17:57:46 -07:00
David Tolnay
bbd2620921
Update ui tests to nightly-2020-06-14 2020-06-13 19:17:21 -07:00
David Tolnay
ae7143655d
Test c method calls without needing PartialEq on Exception 2020-05-22 11:12:35 -07:00
myronahn
e3b78ea409
Fix issue with indirect return for C++ member function w/no args 2020-05-22 11:08:13 -07:00
Myron Ahn
d963bf97b7 Fix for when std::os::raw::c_char is u8 (armv7) 2020-05-17 12:32:42 +07:00
David Tolnay
cf96664b29
Test include parsing 2020-05-11 20:07:34 -07:00
David Tolnay
65bc8e6af8
Detect earlier untyped discriminants out of bounds of later suffix 2020-05-11 00:30:24 -07:00
David Tolnay
f6a89f2813
Respect inferred enum repr in C++ code generator 2020-05-10 23:45:51 -07:00
David Tolnay
c605e6fa61
Respect inferred enum repr in Rust code generator 2020-05-10 23:37:12 -07:00
David Tolnay
560661abe5
Test unsatisfiable discriminant range 2020-05-10 23:32:31 -07:00
David Tolnay
b24f52e289
Test inconsistent suffix on enum discriminants 2020-05-10 23:29:12 -07:00
David Tolnay
f85431239d
Test discriminant outside of the repr's bounds 2020-05-10 23:28:04 -07:00
David Tolnay
f2d584101d
Expand maximum recognized discriminant to 64 bits 2020-05-10 23:23:37 -07:00
Philip Craig
7e14e2e6cb
avoid MSVC warning via flag_if_supported 2020-05-09 12:00:49 -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
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
e2f9ec4c89
Type alias parsing 2020-05-07 19:46:02 -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
Joel Galenson
8854773c56 Compute enum discriminant during parsing
This allows us to reuse the computation in multiple places later.
2020-05-05 08:32:32 -07:00
Joel Galenson
0f654ffeb0 Fix previous commit. 2020-05-04 20:04:21 -07:00
David Tolnay
4c14162d34
Update multi parse errors ui test 2020-05-04 01:30:09 -07:00
David Tolnay
15a6c76352
Add test of invocation with multiple parse errors 2020-05-04 01:29:01 -07:00
Joel Galenson
db1ec31283 Expose the enum value to Rust as a field 2020-05-01 14:00:48 -07:00
David Tolnay
57d81a12fb
Merge pull request #180 from jgalenson/enums
Properly handle enum discriminant overflows.
2020-05-01 10:13:24 -07:00
Joel Galenson
04fa0967e2 Properly handle enum discriminant overflows.
This both checks for enum values that are illegal due to overflow and
ensures we do not overflow on valid enums.
2020-05-01 10:00:31 -07:00
David Tolnay
c4ddb4d172
Add tests for by-value-not-supported errors 2020-05-01 10:00:17 -07:00
David Tolnay
4037de267a
Use a better constant string idiom in test 2020-04-30 22:51:51 -07:00
David Tolnay
f5aeea2e4c
Touch up a variable name in vector test 2020-04-30 22:51:51 -07:00
David Tolnay
9beba146b7
Avoid relying on ADL for std::back_inserter 2020-04-30 22:51:50 -07:00
David Tolnay
d7984c2b7f
Touch up PR 170 2020-04-30 22:50:10 -07:00
David Tolnay
2b12b32113
Update PR 170 compiletests at nightly rustc 2020-04-30 22:03:25 -07:00
Joel Galenson
c03402aee5 Support C-style enums
This adds support for passing C-style enums between Rust and C++.

We use the Rust representation for enums suggested by dtolnay in #132.
Note that as this does not use real enums, Rust code cannot treat them
as normal enums, e.g., by converting them to integers.  But common
uses such as pattern matching remain unchanged.
2020-04-30 14:12:37 -07:00
David Tolnay
f8ed07327b
Split cxx runtime and build components 2020-04-29 18:23:14 -07:00
myronahn
da9be50ad8
Add all std::iterator_traits required types to const_iterator of rust::Vec<T> (#157)
https://en.cppreference.com/w/cpp/iterator/iterator_traits

`std::iterator_traits` requires the following 5 types:

- `difference_type` - a signed integer type that can be used to identify distance between iterators
- `value_type` - the type of the values that can be obtained by dereferencing the iterator. This type is void for output iterators.
- `pointer` - defines a pointer to the type iterated over (value_type)
- `reference` - defines a reference to the type iterated over (value_type)
- `iterator_category` - the category of the iterator. Must be one of iterator category tags.

The current `const_iterator` for `rust::Vec<T>` only defined `value_type` and `reference` which caused an error when using `std::copy` on gcc 7.5.0 on Ubuntu but seemed to work fine on MacOS.
2020-04-28 15:47:23 -07:00
David Tolnay
776fd8953d
Generalize reference-to-reference check to cover all positions
Checking this in check_type_ref allows it to apply anywhere that a
reference is written, such as return position which was not covered by
the previous logic.
2020-04-28 13:38:28 -07:00
Joel Galenson
2bd1312f2f Disallow passing a reference to a reference. 2020-04-28 10:14:41 -07:00
David Tolnay
378ca50c4c
Format PR 159 with clang-format 2020-04-27 16:47:55 -07:00
Joel Galenson
ba67607fa2 Allow wildcard argument names.
This adds support for wildcard variable names by internally giving
them unique names.
2020-04-27 16:00:50 -07:00
David Tolnay
83c69e92f7
Test Rust Vec in Rust signatures 2020-04-25 18:02:19 -07:00
David Tolnay
d2ce8a997b
Fix and test passing Vec by value from Rust to C 2020-04-25 18:02:19 -07:00
David Tolnay
7798969827
Fix and test returning Vec by reference from C to Rust 2020-04-25 18:02:19 -07:00
David Tolnay
8b9d176ea7
Fix and test fallible return of Vec from C to Rust 2020-04-25 18:02:19 -07:00
David Tolnay
b41e74c152
Test returning Vec by value from C to Rust 2020-04-25 18:02:18 -07:00
David Tolnay
de5340ec85
Test returning CxxVector by reference from C to Rust 2020-04-25 18:02:18 -07:00
David Tolnay
2244d1f553
Test passing CxxVector by reference from Rust to C 2020-04-25 18:02:17 -07:00
David Tolnay
1bcc9fe2e5
Test returning opaque types in CxxVector from C to Rust 2020-04-25 18:02:17 -07:00
David Tolnay
9b304204b7
Use more appropriate name for vector arguments in tests 2020-04-25 18:02:17 -07:00
David Tolnay
c87c215f56
Add begin/end iterators to rust::Vec 2020-04-25 18:02:15 -07:00
David Tolnay
e1dcdf7317
Parse vector's type as CxxVector 2020-04-25 18:02:13 -07:00
David Tolnay
c01d0a0f84
Rename CxxVector::size to len to match Rust conventions 2020-04-25 18:02:10 -07:00
David Tolnay
85db5a01b2
Touch up PR 67 2020-04-25 18:02:08 -07:00
David Tolnay
d1413040ae
Remove absolute paths in non-generated code 2020-04-25 18:02:07 -07:00
David Tolnay
4f6dd4e631
Simplify vector tests using UniquePtr deref 2020-04-25 18:02:07 -07:00
David Tolnay
507c2d75cf
Merge pull request #67 from myronahn/master
C++ std::vector<T> and Rust std::vec::Vec<T> support
2020-04-25 18:01:54 -07:00
David Tolnay
7c29546739
Revert some unrelated changes from PR 67 2020-04-25 13:13:43 -07:00
David Tolnay
37dd7e1174
Format with clang-format 2020-04-25 12:51:59 -07:00
Myron Ahn
eba35cfce7
C++ std::vector<T> and Rust std::vec::Vec<T> support
Add basic std::vector and std::vec::Vec support across FFI boundary.
2020-04-25 12:47:04 -07:00
David Tolnay
1044d44f30
Suppress irrelevant "required by this bound" from error message 2020-04-22 20:01:21 -07:00
David Tolnay
4b07ab92e3
Improve span of unsized opaque type error 2020-04-22 19:50:21 -07:00
David Tolnay
ab73957a4e
Add ui test for unnamed receiver type error message 2020-04-22 18:25:43 -07:00
David Tolnay
2dd73eaf03
Add ui test for reserved type names 2020-04-22 17:56:27 -07:00
David Tolnay
7a03847db2
Add ui test for unrecognized receiver type 2020-04-22 16:54:34 -07:00
David Tolnay
6d9f4aab20
Add ui test for disallowed lifetimes 2020-04-22 16:39:44 -07:00
Joel Galenson
e1e969d06f Allow &self without a type when the block only has one type 2020-04-22 08:44:49 -07:00
David Tolnay
5e29b217c3
Rely on UniquePtr Deref impl in tests 2020-04-17 16:44:03 -07:00
Joel Galenson
c1c4e7ac6b Support calling Rust methods from C++
These methods can be declared in the bridge by naming the first
argument self and making it a reference to the containing class, e.g.,
  fn get(self: &R) -> usize;
  fn set(self: &mut R, n: usize);
This syntax requires Rust 1.43.
2020-04-16 16:25:04 -07:00
Joel Galenson
3d4f612b34 Support calling C++ methods from Rust
These methods can be declared in the bridge by naming the first
argument self and making it a reference to the containing class, e.g.,
  fn get(self: &C) -> usize;
  fn set(self: &mut C, n: usize);
This syntax requires Rust 1.43.

Note that the implementation also changes the internal naming of shim
functions so that they also contain the name of the owning class, if
any.  This allows defining multiple methods with the same name on
different objects.
2020-04-16 16:24:48 -07:00
David Tolnay
633b1f5f1f
Switch C-style casting to reinterpret_casts 2020-04-14 16:42:06 -07:00
David Tolnay
efe81052e7
Touch up &[u8] PR 2020-04-14 16:42:06 -07:00
David Tolnay
eb952bac14
Format with rustfmt and clang-format 2020-04-14 16:42:06 -07:00
Adrian Taylor
ec9430e657 Adding missing tests; fixing typo. 2020-04-14 16:12:21 -07:00
Adrian Taylor
f5dd552036 Adding &[u8] support.
This change adds specifically, support for &[u8] with a corresponding
rust::Slice<uint8_t> type. No other types of slice are permitted. The
rationale is that it may be common to pass binary data back and forth
across the FFI boundary, so it's more urgent to get this in place sooner.
Broader support for other slices can wait for the future.

But, both C++ and Rust-side bindings should allow the existing support
to be broadened to other Slice types in future without code changes.

A few specific notes:

* The name "rust::Slice" might be better as "rust::SliceRef" but I'm
  following the precedent of "rust::Str".
* It would be good to add constructors from std::span but as that's
  a C++20 feature, that may have to wait until C++ feature detection
  is resolved.
* Internally, this follows the pattern of &str, where the parser will
  initially recognize this as Type::Ref (of Type::Slice) but then
  will replace that with Type::SliceRefU8. Type::Slice should not
  persist through later stages. As we later come to support other
  types of slice, we would probably want to remove Type::SliceRefU8.
2020-04-14 14:13:48 -07:00
David Tolnay
b5609f86ca
Add UniquePtr test 2020-04-09 23:44:23 -07:00
David Tolnay
a95b2341d0
Suppress clippy::ptr_arg triggering on &String in tests 2020-04-09 23:26:16 -07:00
David Tolnay
75dca2e846
Passing function pointer from Rust to C++ 2020-03-29 21:50:25 -07:00
David Tolnay
9964262630
Implement and test some more fallible return types 2020-03-25 16:44:11 -07:00
David Tolnay
42ebfa2d5e
Add some PartialEq impls for CxxString 2020-03-25 12:26:22 -07:00
David Tolnay
f90ce8585b
Remove trailing whitespace from tests from PR 83 2020-03-25 12:15:18 -07:00
Myron Ahn
8484930071 Result now works for UniquePtr and other types 2020-03-25 22:39:00 +07:00
David Tolnay
09462acd4b
Disallow shared structs having 0 fields 2020-03-20 14:58:56 -07:00
David Tolnay
265f6a079d
Suppress some clippy lints in test suite 2020-03-18 20:14:00 -07:00
David Tolnay
1a2683ac22
Allow .rs.h extension when including generated header 2020-03-17 19:13:22 -07:00
David Tolnay
bffcdd5f4b
Use consistent filenames for generated code
This makes it clearer that the filename doesn't need to be connected to
the rule name.
2020-03-17 19:12:38 -07:00
David Tolnay
ebef4a23a2
Implement fallible C++ functions 2020-03-17 17:34:52 -07:00
David Tolnay
cecada6d38
Fix fallible void return 2020-03-17 01:46:07 -07:00
David Tolnay
b6c5ea7233
Add Rust fallible test functions 2020-03-17 00:15:48 -07:00
David Tolnay
736cbcad40
Move header include path to rust/cxx.h 2020-03-11 16:51:38 -07:00
David Tolnay
85db248625
Test returning unique_ptr<string> from Rust to C++ 2020-03-06 16:26:46 -08:00
David Tolnay
2fe58c670c
Declare test suite helpers noexcept 2020-03-06 16:23:09 -08:00
David Tolnay
4b3a66edf1
Implement returning unique_ptr from Rust to C++ 2020-03-06 16:22:14 -08:00
David Tolnay
5cd8d61f9d
Implement returning Box from Rust to C++ 2020-03-06 16:18:44 -08:00
David Tolnay
a7d00e8281
Test &R passed from Rust to C++ 2020-03-06 15:53:33 -08:00
David Tolnay
be13d8ad2c
Test Box returned from C++ to Rust 2020-03-06 15:50:24 -08:00
David Tolnay
40226ab58a
Implement passing ownership of string to Rust 2020-03-03 00:05:35 -08:00
David Tolnay
750755e557
Rename namespace to rust::inline cxxbridge01 2020-03-01 13:47:29 -08:00
David Tolnay
324437a263
Rename C++ RustBox to Box 2020-03-01 13:47:29 -08:00
David Tolnay
09dbe75a5d
Rename C++ RustStr to Str 2020-03-01 13:47:28 -08:00
David Tolnay
5608216979
Rename C++ RustString to String 2020-03-01 13:47:28 -08:00
David Tolnay
63576d458d
Move build -> tools/bazel
Fixes https://github.com/dtolnay/cxx/issues/45.
2020-02-25 00:13:25 -08:00
David Tolnay
9bc613e7db
Add test suite targets for buck and bazel 2020-02-23 00:36:44 -08:00
David Tolnay
e3e0a71291
Use the public cxxbridge.h include path 2020-02-23 00:18:57 -08:00
David Tolnay
f306da4dc7
Test c++ calling to rust 2020-02-22 22:42:35 -08:00
David Tolnay
3fd7f56275
Test rust calling to c++ 2020-02-22 20:02:02 -08:00
David Tolnay
b871577737
Format with clang-format 2020-02-22 19:31:49 -08:00
David Tolnay
ad5b8afd9b
Add exhaustive coverage of signature kinds 2020-02-22 19:31:49 -08:00
David Tolnay
97c7210039
Add test suite beyond the existing demo 2020-02-22 19:31:49 -08:00
David Tolnay
bd3a6b27fb
Update ui tests to nightly-2020-02-08 2020-02-07 16:58:20 -08:00
David Tolnay
7db7369797
Safe FFI between Rust and C++ 2020-01-08 08:57:24 -08:00