portable-atomic-util: Example for Arc<dyn Trait> #143
Labels
A-portable-atomic-util
Area: related to portable-atomic-util crate
C-documentation
Category: related to documentation.
S-blocked
Status: Blocked on something else
Hello,
I am trying to port a crate that uses
Arc<dyn Trait>
for dynamic dispatch to but I could not find a way to do this with this crate.Minimal example:
The error I get:
an 'as' expression can only be used to convert between primitive types or to coerce to a specific trait object
.This example works if
use portable_atomic_util::Arc;
is replaced withuse alloc::sync::Arc;
, though the latter is not available on my target architecture (thumbv6m),.I also tried calling
.into()
and.try_into()
on the Arc, as well as converting the Foo object like this:but those methods work neither on this crate's Arc nor alloc's.
Is there a way to do this using this crate?
The text was updated successfully, but these errors were encountered: