Commit Graph

20 Commits

Author SHA1 Message Date
David Tolnay
09011c304b
Fix alignment of by-value returns from Rust 2020-03-06 14:46:46 -08:00
David Tolnay
f51447e2b9
Implement moving ownership of struct arguments to Rust 2020-03-06 14:22:00 -08:00
David Tolnay
33169bdd59
Safe to assume more about the Box representation
https://doc.rust-lang.org/std/boxed/index.html:
So long as T: Sized, a Box<T> is guaranteed to be represented as a
single pointer and is also ABI-compatible with C pointers (i.e. the C
type T*).
2020-03-06 13:10:58 -08:00
David Tolnay
9c68b1a0c6
Lazily compute include set 2020-03-06 11:27:29 -08:00
David Tolnay
cc3767f0ed
Format with rustfmt 2019-10-07 2020-03-06 10:42:02 -08:00
David Tolnay
a46a237fe7
Make passing String by value to C++ const 2020-03-06 10:28:15 -08:00
David Tolnay
f6292378c7
Add rust::Box member type aliases 2020-03-01 21:09:11 -08:00
David Tolnay
baae443ae2
Change Str to Repr operator to explicit 2020-03-01 20:20:10 -08:00
David Tolnay
9081beb1a0
Remove redundant prefix from mangled Box related symbols 2020-03-01 19:52:09 -08:00
David Tolnay
9ad1fbc478
Pass ending comment to end_block
Clang-format doesn't always like the same ending comment as the start of
the block. In particular it wants:

    inline namespace cxxbridge01 {
      ...
    } // namespace cxxbridge01
2020-03-01 14:05:01 -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
7e219b8099
Use absolute qualified identifiers in generated C++
This avoids collision with the user's namespaces having the same name.

Less important in the context of the current names right now, but more
important after we move our public C++ API from cxxbridge:: to rust::.
In fact our example code already uses org::rust:: as the namespace,
inside of which a non-absolute rust:: would cause trouble.
2020-03-01 13:14:55 -08:00
David Tolnay
4a44122b0f
Resolve Wreturn-type-c-linkage warnings 2020-01-25 16:26:54 -08:00
David Tolnay
8861bee797
Support opaque types that are not structs 2020-01-20 18:40:16 -08:00
David Tolnay
17955e2e8c
Implement special case types in extern Rust argument position 2020-01-20 18:09:41 -08:00
David Tolnay
e43b737f2c
Release 0.1.0 2020-01-08 08:57:24 -08:00
David Tolnay
7db7369797
Safe FFI between Rust and C++ 2020-01-08 08:57:24 -08:00