Skip to content

can't call foreign functions from cmath (libm) #667

Closed

Description

I just tried cargo miri test on the various num crates. I got pretty far, but I was stopped by errors on foreign function calls from std::sys::cmath, which come from libm on unix platforms. For example:

num-complex:

error[E0080]: constant evaluation error: can't call foreign function: hypot
   --> /home/jistone/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/f64.rs:533:18
    |
533 |         unsafe { cmath::hypot(self, other) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: hypot
    |

num-integer:

   --> /home/jistone/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/f64.rs:513:18
    |
513 |         unsafe { cmath::cbrt(self) }
    |                  ^^^^^^^^^^^^^^^^^ can't call foreign function: cbrt
    |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions