Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile in no_std project #7

Open
michaelkamprath opened this issue Dec 31, 2023 · 2 comments
Open

Unable to compile in no_std project #7

michaelkamprath opened this issue Dec 31, 2023 · 2 comments

Comments

@michaelkamprath
Copy link

I am trying to use rclite in a rp2040 project that is no_std. However, the library won't compile:

   Compiling rclite v0.2.4
error[E0599]: no method named `fetch_sub` found for struct `AtomicUsize` in the current scope
   --> /Users/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rclite-0.2.4/src/arc.rs:434:26
    |
434 |         if inner.counter.fetch_sub(1, Ordering::Release) != 1 {
    |                          ^^^^^^^^^ method not found in `AtomicUsize`

error[E0599]: no method named `fetch_add` found for struct `AtomicUsize` in the current scope
   --> /Users/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rclite-0.2.4/src/arc.rs:592:42
    |
592 |         let count = self.inner().counter.fetch_add(1, Ordering::Relaxed);
    |                                          ^^^^^^^^^ method not found in `AtomicUsize`

error[E0599]: no method named `fetch_sub` found for struct `AtomicUsize` in the current scope
   --> /Users/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rclite-0.2.4/src/arc.rs:609:33
    |
609 |         if self.inner().counter.fetch_sub(1, Ordering::Release) != 1 {
    |                                 ^^^^^^^^^ method not found in `AtomicUsize`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `rclite` (lib) due to 3 previous errors

I am using an extern allocator embedded-alloc. Any thoughts on what might be going wrong here?

@fereidani
Copy link
Owner

It seems like your target doesn't support atomic usize operations.

@michaelkamprath
Copy link
Author

Yeah, this issue seems relevant. The Raspberry Pi Pico (rp2040) is a thumbv6m target.

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

No branches or pull requests

2 participants