Skip to content

Build issue with no_std #12

@ralphtandetzky

Description

@ralphtandetzky

Common issues

Problem: The package causes builds to fail when building with #![no_std].

Quick solution: It looks like this has already been addressed in the commit 6169a5261b496b319be4daefc52e3f010b688e08"rand_distr: fix no_std build". It would be great if a patch would be released sometime soon.

Details: My crate fails to build in the CI when I try to update to rand 0.9.0 and rand_distr 0.5.0. See https://github.com/ralphtandetzky/num-quaternion/actions/runs/13338283033/job/37258123493?pr=129. Therefore, this is blocking updating the dependencies of my crate.

The reasons is that in no_std builds, f64 does not provide the method abs() by itself. Therefore, the line

use num_traits::Float;

is necessary to pull in the abs() method in the file src/utils.rs. This line was removed in the new major version 0.5.
This problem does not occur with rust 1.84, but apparently with all older versions of the rustc compiler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions