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

Make the crate no_std compatible? #89

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Make the crate no_std compatible? #89

wants to merge 11 commits into from

Conversation

JSorngard
Copy link
Collaborator

I may have figured out a way to make the crate no_std compatible!

I added the std feature (disabled by default currently) that can be activated to enable the current Backtrace functionality of the error types, since that needs the standard library.

Potential trade-offs:

  • rayon depends on the standard library, so if that feature is enabled it doesn't really matter that we are no_std.
  • Depend on the libm crate to compute square roots and trigonometric functions if the std feature is disabled. When the std feature is enabled we depend on libm even if we never use it.
  • Increases the minimum compatible Rust version to 1.81 since we then use the Error trait in core.

Roadblocks

Currently the compiler complains when I run cargo check that there is no allocator, but it works when I run cargo test. I do not know how to resolve this yet. I am also confused about why it doesn't work right now, as I have already used the functionality I use here to make my const-primes crate no_std, and that worked without this issue.

@JSorngard JSorngard added enhancement New feature or request question Further information is requested labels Nov 15, 2024
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 91.95402% with 7 lines in your changes missing coverage. Please review.

Project coverage is 94.77%. Comparing base (41f0172) to head (5187bb8).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
src/data_api.rs 70.00% 3 Missing ⚠️
src/hermite/mod.rs 87.50% 1 Missing ⚠️
src/legendre/mod.rs 80.00% 1 Missing ⚠️
src/midpoint/mod.rs 80.00% 1 Missing ⚠️
src/simpson/mod.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #89      +/-   ##
==========================================
- Coverage   94.78%   94.77%   -0.02%     
==========================================
  Files           9       10       +1     
  Lines        1689     1742      +53     
==========================================
+ Hits         1601     1651      +50     
- Misses         88       91       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@JSorngard JSorngard requested a review from DomiDre November 15, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant