Skip to content

Conversation

rursprung
Copy link

this introduces a new optional feature std and an initial Format implementation just for Mutex. the hope is that over time more and more Format impls for std can be added for those who need it.

the trigger for this is that i broke the embassy-sync build for std by adding a Format derive to something which was using Mutex internally and it wasn't covered by CI there (which by now is rectified). in the ensuing conversation on Matrix it was stated that it might be nice to have defmt impls for std as well, even if only very few users would exist for this (i'm not one of them, which is how i ended up breaking CI).

this introduces a new optional feature `std` and an initial `Format`
implementation just for `Mutex`. the hope is that over time more and
more `Format` impls for `std` can be added for those who need it.

the trigger for this is that i broke the `embassy-sync` build for `std`
by adding a `Format` derive to something which was using `Mutex`
internally and it wasn't covered by CI there (which by now is
rectified). in the ensuing conversation on Matrix it was stated that it
might be nice to have `defmt` impls for `std` as well, even if only very
few users would exist for this (i'm not one of them, which is how i
ended up breaking CI).

part of knurling-rs#979
@rursprung rursprung force-pushed the add-std-mutex-Format-impl branch from 09c7505 to 9ab9174 Compare July 29, 2025 13:02
@rursprung
Copy link
Author

CI currently doesn't seem to test with different features, e.g. it doesn't seem to test with the alloc feature either, so i didn't add std somewhere. i think you should update CI to at least test alloc (unrelated to this PR), probably by relying on the build matrix and adding different feature combinations (at least "no features" and "all features") to it

@jonathanpallant
Copy link
Contributor

Just copying what I said on #979, there are currently very few std targets where defmt works, and that needs fixing first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants