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

Fixed the build, TryFrom seems to be feature gated in num_bigint #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gamozolabs
Copy link

Fixed the build. It seems num_bigint gates behind TryFrom. I'm not sure if this is the right fix, as I would suspect this is something that should be auto-detected.

pleb@gamey ~/test/rscalc $ make
cargo build --target thumbv7em-none-eabihf -Z build-std=core,alloc --release --no-default-features --features dm42
   Compiling core v0.0.0 (/usr/lib/rust/1.48.0/lib/rustlib/src/rust/library/core)
   Compiling rscalc v0.1.0 (/home/pleb/test/rscalc)
   Compiling rustc-std-workspace-core v1.99.0 (/usr/lib/rust/1.48.0/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling compiler_builtins v0.1.35
   Compiling alloc v0.0.0 (/usr/lib/rust/1.48.0/lib/rustlib/src/rust/library/alloc)
   Compiling scopeguard v1.1.0
   Compiling num-traits v0.2.14
   Compiling spin v0.5.2
   Compiling intel_dfp v0.1.0 (/home/pleb/test/rscalc/intel_dfp)
   Compiling lock_api v0.3.4
   Compiling lazy_static v1.4.0
   Compiling spinning_top v0.1.1
   Compiling linked_list_allocator v0.8.8
   Compiling num-integer v0.1.44
   Compiling num-bigint v0.3.1
   Compiling chrono v0.4.19
   Compiling rscalc_math v0.1.0 (/home/pleb/test/rscalc/math)
error[E0432]: unresolved import `num_bigint::TryFromBigIntError`
 --> math/src/error.rs:2:5
  |
2 | use num_bigint::TryFromBigIntError;
  |     ^^^^^^^^^^^^------------------
  |     |           |
  |     |           help: a similar name exists in the module: `ParseBigIntError`
  |     no `TryFromBigIntError` in the root

error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
  --> math/src/error.rs:57:6
   |
57 | impl<T> From<TryFromBigIntError<T>> for Error {
   |      ^ unconstrained type parameter

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0207, E0432.
For more information about an error, try `rustc --explain E0207`.
error: could not compile `rscalc_math`

@gamozolabs
Copy link
Author

Perhaps this is something weird about my environment. But I would expect https://github.com/rust-num/num-bigint/blob/master/build.rs#L19 should be detecting and setting this feature. I'm not sure why it is not.

@vitasam
Copy link

vitasam commented Jul 10, 2022

I have faced the same problem, and your fix seems to solve it.

However, there is another problem (at least with my environment):
note: rust-lld: error: duplicate symbol: __aeabi_d2f

@vitasam
Copy link

vitasam commented Jul 11, 2022

Fixed this aeabi_d2f problem with DM42 build - it looks quite impressive on DM42 hardware

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