News for hackers. Stuff that matters.
Re:Improving Interoperability Between Rust and C++ by TheCoreh on Monday February 05, 2024 @03:27PM (#39266658)
Isn't this just `&dyn Trait`?

Would it be a stack allocated, owning version of that, that can be moved? A pure `dyn Trait`?

Re:Improving Interoperability Between Rust and C++ by Ericson2314 on Monday February 05, 2024 @03:34PM (#39266768)
No. &mut dyn Foo is sugar for something like

    struct DynFoo<erase T> {
        vtable: &mut VTableFoo<T>
        ptr: &mut T
    }
This is the underlying feature. `dyn` is a bit of an ad-hoc hack around not having this feature.