rust-embedded / nb

Minimal and reusable non-blocking I/O layer
Apache License 2.0
86 stars 15 forks source link

nb is incompatible with async/await which is now in stable #19

Closed therealprof closed 4 years ago

therealprof commented 4 years ago

As noticed when trying to change embedded-hal to edition 2018, a number of examples using the nb::await! macro fail to compile: https://github.com/rust-embedded/embedded-hal/pull/167

However async/await is currently not available in no_std due to the implicit use of TLS.

Can we come up with some workaround might would us to unbreak the use of the primitives provided by this crate or should we leave nb unchanged and remove the offending examples until async/await becomes usable?

cc @japaric cc @Nemo157 cc @no111u3

no111u3 commented 4 years ago

I updated review and temporary fixed problems with nb but it doesn't sounds good - It looks like a hack: r# prefixes wouldn’t be an ergonomic solution that users are familiar with.

no111u3 commented 4 years ago

Initial review was merged. Now I have some solution - replace everything of nb use to core::task::Poll: https://github.com/rust-embedded/embedded-hal/pull/171. But I have no solution to change nb package as crate.

therealprof commented 4 years ago

I think we can close this for now. For async/await we'll come up with a different plan an we're going to keep this as is for now.