georust / geo

Geospatial primitives and algorithms for Rust
https://crates.io/crates/geo
Other
1.51k stars 195 forks source link

"cargo add geo-types -F rstar" -> failed to resolve: use of undeclared crate or module `approx` #1044

Open apps4uco opened 1 year ago

apps4uco commented 1 year ago

Enabling the rstar feature breaks build of a vanilla crate.

Its a minor inconvenience as there is an easy workaround, (see below) but I just thought Id report it.

Presumably the Cargo.toml should enable the approx feature if any of the features rstar... are added

Maybe related to #825

Steps to reproduce:

cargo new geotype-bug
cargo add geo-types -F rstar
cargo build  

Output:

...
error[E0433]: failed to resolve: use of undeclared crate or module `approx`
   --> /Users/andy/.cargo/registry/src/-ea8217003c7340b4/geo-types-0.7.11/src/private_utils.rs:119:5
    |
119 |     approx::relative_eq!(distance, 0.0)
    |     ^^^^^^ use of undeclared crate or module `approx`

Expected

Expected it to compile with no error message or warning

Workaround:

cargo add geo-types -F rstar,approx

By the way I believe it occurs with any of the rstar_ features.

frewsxcv commented 1 year ago

Action items here: