David Tolnay
b6b6d2eb88
Add test of size_of, align_of
2020-12-27 12:20:25 -08:00
David Tolnay
ee6ecfcf91
Add rust::size_of, align_of accessors that work for opaque types
2020-12-27 12:20:25 -08:00
David Tolnay
7506863fa4
Move is_complete type trait to header
2020-12-27 12:20:25 -08:00
David Tolnay
dd36736a99
Merge pull request #596 from dtolnay/layout
...
Improve rustc diagnostic when an extern Rust type is unsized
2020-12-27 12:20:09 -08:00
David Tolnay
0aa9d205da
Further reduce the rustc diagnostic when an extern Rust type is unsized
2020-12-27 12:12:17 -08:00
David Tolnay
03267369cc
Consolidate error on unsized extern Rust type
2020-12-27 12:12:17 -08:00
David Tolnay
6f257a85e7
Merge pull request #595 from dtolnay/layout
...
Emit private layout struct for all opaque types
2020-12-27 12:12:06 -08:00
David Tolnay
9643703a3f
Generate sizeof and alignof symbols
2020-12-27 12:04:01 -08:00
David Tolnay
358bc4b383
Connect opaque type layout accessors to Rust symbols
2020-12-27 11:54:54 -08:00
David Tolnay
6ba262f630
Emit private layout struct for all opaque types
2020-12-27 00:54:53 -08:00
David Tolnay
0c9c3e6e33
Use the same ordering of < <= > >= operators everywhere
2020-12-27 00:52:25 -08:00
David Tolnay
d9317eb06b
Fully qualify Sized and Unpin traits in generated code
...
This avoids problematic changes in meaning if the caller's bridge
contains a type called "Sized" or "Unpin".
2020-12-26 23:30:40 -08:00
David Tolnay
cdda5d0836
Merge pull request #594 from dtolnay/opaque
...
Set rust::Opaque as base class of all opaque Rust types
2020-12-26 21:26:45 -08:00
David Tolnay
8d067de62e
Set rust::Opaque as base class of all opaque Rust types
2020-12-26 21:15:37 -08:00
David Tolnay
158972019a
Release 1.0.21
1.0.21
2020-12-23 11:37:21 -08:00
David Tolnay
458459f7d1
Document rename attribute on types in book
2020-12-23 11:21:28 -08:00
David Tolnay
c528d671ff
Update std::string example code to use cxx_name attribute
2020-12-23 11:19:36 -08:00
David Tolnay
8e5af76cf0
Merge pull request #591 from dtolnay/vecitermut
...
Mutable iterator for CxxVector
2020-12-21 17:45:59 -08:00
David Tolnay
26a5292598
Mutable iterator for CxxVector
2020-12-21 17:39:18 -08:00
David Tolnay
0d52717355
Simplify CxxVector iterator next method
2020-12-21 17:35:24 -08:00
David Tolnay
cbf0964a7c
Merge pull request #589 from dtolnay/vecgetmut
...
Add mutable indexing for CxxVector
2020-12-21 17:32:20 -08:00
David Tolnay
767e00d195
Add mutable indexing for CxxVector
2020-12-21 17:23:33 -08:00
David Tolnay
abf03e7703
Merge pull request #588 from dtolnay/variant
...
Support cxx_name/rust_name attributes on enum variants
2020-12-21 16:58:22 -08:00
David Tolnay
f221718091
Add some use of enum variant rename in tests
2020-12-21 16:47:26 -08:00
David Tolnay
6bf9ef4749
Parse cxx_name and rust_name attributes on enum variants
2020-12-21 16:26:41 -08:00
David Tolnay
e6f6214c00
Store enum variant name as Pair
2020-12-21 16:26:41 -08:00
David Tolnay
b11c9ef640
Show intended usage example on attrs::Parser
2020-12-21 16:26:22 -08:00
David Tolnay
d25033c28e
Work around clippy needless_update lint on attrs::Parser
2020-12-21 16:24:19 -08:00
David Tolnay
2680923a7e
Factor out variant parse logic
2020-12-21 16:07:14 -08:00
David Tolnay
c2a4c78a13
Inline Pair construction
2020-12-21 15:55:31 -08:00
David Tolnay
885be13744
Parse cxx_name/rust_name attrs on all syntax tree nodes holding Pair
2020-12-21 15:53:53 -08:00
David Tolnay
a2dfcbfde6
Match argument order between attr parser and Pair::new
2020-12-21 15:46:24 -08:00
David Tolnay
6a990f8035
Factor out a Pair constructor for common parser use case
2020-12-21 15:43:08 -08:00
David Tolnay
ddbcb524b9
Parser minor cleanup
2020-12-21 15:38:44 -08:00
David Tolnay
bc954d94e0
Defer generics errors until after attribute errors
...
All attribute errors are nonfatal so we might as well report them all
even if an input contains unsupported generics.
2020-12-21 15:17:12 -08:00
David Tolnay
7cd9fec04c
Touch up Pair and RustName construction for consistency
2020-12-21 15:03:23 -08:00
David Tolnay
20cc2d35bd
Expose Pair construction only from differing idents
2020-12-21 15:01:07 -08:00
David Tolnay
dee9fa3853
Simplify Pair to fully qualified
2020-12-21 14:40:50 -08:00
David Tolnay
2d99b00fcc
Inline some niche RustName methods
2020-12-21 14:34:35 -08:00
David Tolnay
fa5a4a6b5b
Add debug assertions to some Vec indexing
2020-12-21 14:08:08 -08:00
David Tolnay
d4fff5d951
Mark Vec front/back noexcept
2020-12-21 14:04:11 -08:00
David Tolnay
5965894ca8
Remove includes duplicated between cxx.h and cxx.cc
2020-12-21 13:58:45 -08:00
David Tolnay
c5ef010349
Release 1.0.20
1.0.20
2020-12-21 13:34:59 -08:00
David Tolnay
233c88bc8f
Lockfile update
2020-12-21 13:32:28 -08:00
David Tolnay
133a9b978b
Recognize extern function return value as trivial reason
2020-12-21 13:30:47 -08:00
David Tolnay
8a01b9d1a1
Merge pull request #587 from dtolnay/trivial
...
Join trivial reasons in one message
2020-12-21 13:22:48 -08:00
David Tolnay
5b1d863c1e
Join trivial reasons in one message
2020-12-21 13:13:35 -08:00
David Tolnay
ee0ccbe4cd
Focus pin mut opaque message on Pin suggestion
...
In common usage the Pin<&mut T> is going to be the right fix most of the
time. In all of these cases the user is *also* going to receive a
suggestion to implement ExternType. That suggestion will appear pointing
to the opaque extern `type` item.
2020-12-21 13:05:55 -08:00
David Tolnay
0286de8011
Clean up type name in IsRelocatable static assertion message
2020-12-20 22:00:20 -08:00
David Tolnay
0634b1f28c
Extract trivial extern type alias detection to module
2020-12-20 21:12:11 -08:00