-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legitimate uses for UniquePtrs even if not currently expanded #236
Comments
(that last sentence may be wrong, but that's what I reckon is happening, based on hunting for a workaround!) Maybe the fix is to assume any type can be a |
You guessed right -- this is exactly why. The easiest workaround currently would be add an unused struct inside of the struct ExtraInstantiations {
_0: UniquePtr<ScopedFeatureList>,
} I had been hoping not to generate impls for every possible use of every type. Maybe doing it for just UniquePtr wouldn't be so bad. But once we start having maps, we'll need some better solution anyway: it wouldn't be good to instantiate std::map<K, V> for every possible combination of K, V. As far as hacks go, an unused struct like that isn't the worst thing, but I am definitely open to supporting this better (with an attribute, or something else that makes the intent clearer; I really don't know). |
#228 (comment) gives code like this (I've changed the type names but nothing else):
This doesn't compile because:
This is because
expand_unique_ptr
never gets called, because no methods in theffi
block take aUniquePtr<ScopedFeatureList>
as a parameter.The text was updated successfully, but these errors were encountered: