vorner / arc-swap

Support atomic operations on Arc itself

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

!Sized support

Ten0 opened this issue · comments

Arc does not have a Sized requirement for its use, however due to a lacking ?Sized bound on impl RefCnt for Arc, this library can't be used to store e.g. ArcSwap<dyn Config>.

Is there a technical limitation that prevents this? Or could it be implemented?

Dupe of #27

I haven't found it in the documentation though

It is indeed a bit buried in there. But AFAIK this is not the first thing someone coming to the crate needs to know.

https://docs.rs/arc-swap/1.3.1/arc_swap/docs/limitations/index.html

It would be great if the crate could somehow supply an error hint when that happens, but I don't know of a way to do that :-|

It would be great if the crate could somehow supply an error hint when that happens, but I don't know of a way to do that :-|

Unfortunately that feature does not exist. This is something Diesel has been looking for for a while as well.

The feature doesn't, but I wouldn't be too surprised if someone came up with a hack, like making the compiler output something like types don't match, expected: WeDontSupportUnsizedSeeTheDocsWhy 😈

The feature doesn't, but I wouldn't be too surprised if someone came up with a hack, like making the compiler output something like types don't match, expected: WeDontSupportUnsizedSeeTheDocsWhy smiling_imp

https://github.com/diesel-rs/diesel/blob/a39dd2ebc5acccb8cde73d40b0d81dde3e073170/diesel/src/query_source/mod.rs#L129-L158