Make is_complete
static assertion unconditional for unique_ptr<T>
bindings.
#1536
+372
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PTAL?
FWIW I tried to leave a justification of small design/coding decisions here and there in code comments + in the description of the last commit.
Similarly to my last PR, this one is also secretly part of a bigger work item (*). I hope that when the bigger work item is done, then
enum UniquePtr
,trait ToTypename
, andtrait ToMangled
can be removed altogether fromgen/src/write.rs
. But even if this doesn't materialize, the changes from this PR under review seem desirable on their own (adding test coverage for C++-side errors + simplifyingfn write_unique_ptr_common
and removing some uses/deconstructions ofUniquePtr
).WDYT?
(*) "bigger work item" has evolved from trying to add support for
Vec<[u8; N]>
to adding support forVec<T>
whereT
is not necessarily a simple identifier (e.g. forVec<Vec<T>>
). I am still working at this point on the last few remaining places wherewrite.rs
orexpand.rs
only work with identifier-only/named types (one of those places isconditional_delete
, another isis_maybe_trivial
, andfn write_unique_ptr_common
is another one).