however, we'd really like to have dyn Trait support. we tried to do it with selfref 0.2.0 but it doesn't seem to work. any ideas how we might be able to pull it off?
alright so it turns out we're not done yet. we uh.
it does work with ?Sizedexceptselfref::opaque! doesn't. for example:
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> src/lib.rs:105:5
|
105 | / selfref::opaque! {
106 | | impl[T: ?Sized] Opaque for IntrusiveLCellKey<T> {
| | - this type parameter needs to be `std::marker::Sized`
107 | | type Kind<'this> = IntrusiveLCell<'this, T>;
108 | | }
109 | | }
| |_____^ doesn't have a size known at compile-time
|
note: required because it appears within the type `IntrusiveLCell<'_, T>`
--> src/lib.rs:100:12
|
100 | struct IntrusiveLCell<'a, T: ?Sized> {
| ^^^^^^^^^^^^^^
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
= note: this error originates in the macro `selfref::opaque` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
106 - impl[T: ?Sized] Opaque for IntrusiveLCellKey<T> {
106 + impl[T] Opaque for IntrusiveLCellKey<T> {
|
This happens because of how we expand the "UB check":