Dyn is currently Send+Sync, so `VRc<WhateverVTable, Dyn>` is also
Send+Sync. So we shouldn't really allow conversion between
`VRc<WhateverVTable, SomeThingNotSend>` to `VRc<_, Dyn>` that can be
sent between threads
This is a breaking change of the vtable crate, but also a soundness fix
Also VRc shouldn't be shared between thread if the vtable itself can't
be shared between threads
```
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> helper_crates/vtable/src/vrc.rs:109:56
|
109 | let mut layout = VTable::drop_in_place(&*vtable, data);
| ^^^^^^^^ help: change this to: `*vtable`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> helper_crates/vtable/src/vrc.rs:124:37
|
124 | VTable::dealloc(&*vtable, self.inner.cast().as_ptr(), layout);
| ^^^^^^^^ help: change this to: `*vtable`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
```
We can't create references for things that aren't represented by the
reference. Even if we never dereference that reference.
Also add a miri test in the CI that runs the test on crate which are
error free.
Since the new version also depends on the ctirical-section 1.0 crate
we need to enable the relevant API in the cortex-m crate because the
rp2040-hal doesn't have it yet
Because re-generating the Skia image is slow and there is no point
storing both the image buffer and the SkiaImage in the cache as it
is basically the same information.
```
warning: unused return value of `alloc::boxed::Box::<T>::from_raw` that must be used
Warning: --> internal/core/properties.rs:382:9
|
382 | Box::from_raw(_self as *mut BindingHolder<B>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
```
Just do what the note says
* vtable: Add Debug implementation to VRc
This will just print the pointer value to be able to destinguish between
different VRcs.
* Derive Debug implmentation for ItemRc
This needs vtable::VRc to have a Debug implementation!
* Update helper_crates/vtable/src/vrc.rs
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
The ffi function wrapper need to be changed because in the 2021 edition, when
the capture is moved into the closure, it moves the individual field instead
of the whole wrapper. But we need to move the whole wrapper because the Drop
of the wrapper will delete the C++ closure, and we don't want to call the
closure after it is deleted.