You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to run the code from the website (such as this ), but when I ran it, I found a conflict with num-trait-0.2.15. I'll attach the error below.
`--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:474:35
|
474 | z = p + z.copysign(p);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
474 | z = p + num_traits::Float::copysign(z, p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
474 | z = p + RealNumber::copysign(z, p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:573:64
|
573 | let s = (p * p + q * q + r * r).sqrt().copysign(p);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
573 | let s = num_traits::Float::copysign((p * p + q * q + r * r).sqrt(), p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
573 | let s = RealNumber::copysign((p * p + q * q + r * r).sqrt(), p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0283]: type annotations needed
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:524:29
|
524 | y = T::from(0.75).unwrap() * s;
| ^^^^^^^ cannot infer type for type {float}
|
= note: multiple impls satisfying {float}: ToPrimitive found in the num_traits crate:
- impl ToPrimitive for f32;
- impl ToPrimitive for f64;
note: required by a bound in num_traits::NumCast::from
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/cast.rs:704:16
|
704 | fn from<T: ToPrimitive>(n: T) -> Option;
| ^^^^^^^^^^^ required by this bound in num_traits::NumCast::from
help: consider specifying the type argument in the function call
|
524 | y = T::from::(0.75).unwrap() * s;
| +++++
error[E0283]: type annotations needed
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:525:29
|
525 | x = T::from(0.75).unwrap() * s;
| ^^^^^^^ cannot infer type for type {float}
|
= note: multiple impls satisfying {float}: ToPrimitive found in the num_traits crate:
- impl ToPrimitive for f32;
- impl ToPrimitive for f64;
note: required by a bound in num_traits::NumCast::from
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/cast.rs:704:16
|
704 | fn from<T: ToPrimitive>(n: T) -> Option;
| ^^^^^^^^^^^ required by this bound in num_traits::NumCast::from
help: consider specifying the type argument in the function call
|
525 | x = T::from::(0.75).unwrap() * s;
| +++++
error[E0283]: type annotations needed
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:526:29
|
526 | w = T::from(-0.4375).unwrap() * s * s;
| ^^^^^^^ cannot infer type for type {float}
|
= note: multiple impls satisfying {float}: ToPrimitive found in the num_traits crate:
- impl ToPrimitive for f32;
- impl ToPrimitive for f64;
note: required by a bound in num_traits::NumCast::from
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/cast.rs:704:16
|
704 | fn from<T: ToPrimitive>(n: T) -> Option;
| ^^^^^^^^^^^ required by this bound in num_traits::NumCast::from
help: consider specifying the type argument in the function call
|
526 | w = T::from::(-0.4375).unwrap() * s * s;
| +++++
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/svd.rs:119:35
|
119 | g = -s.sqrt().copysign(f);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
119 | g = -num_traits::Float::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
119 | g = -RealNumber::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/svd.rs:155:35
|
155 | g = -s.sqrt().copysign(f);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
155 | g = -num_traits::Float::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
155 | g = -RealNumber::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/svd.rs:302:59
|
302 | f = ((x - z) * (x + z) + h * ((y / (f + g.copysign(f))) - h)) / x;
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
302 | f = ((x - z) * (x + z) + h * ((y / (f + num_traits::Float::copysign(g, f))) - h)) / x;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
302 | f = ((x - z) * (x + z) + h * ((y / (f + RealNumber::copysign(g, f))) - h)) / x;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~‰`
The text was updated successfully, but these errors were encountered:
I suddenly get the same conflicts, with other crates. Could you please release a new version (0.2.1) with this fix in place, so it can be installed directly by cargo? Thank you.
I wanted to run the code from the website (such as this ), but when I ran it, I found a conflict with num-trait-0.2.15. I'll attach the error below.
`--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:474:35
|
474 | z = p + z.copysign(p);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
474 | z = p + num_traits::Float::copysign(z, p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
474 | z = p + RealNumber::copysign(z, p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:573:64
|
573 | let s = (p * p + q * q + r * r).sqrt().copysign(p);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
573 | let s = num_traits::Float::copysign((p * p + q * q + r * r).sqrt(), p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
573 | let s = RealNumber::copysign((p * p + q * q + r * r).sqrt(), p);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0283]: type annotations needed
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:524:29
|
524 | y = T::from(0.75).unwrap() * s;
| ^^^^^^^ cannot infer type for type {float}
|
= note: multiple impls satisfying {float}: ToPrimitive found in the num_traits crate:
- impl ToPrimitive for f32;
- impl ToPrimitive for f64;
note: required by a bound in num_traits::NumCast::from
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/cast.rs:704:16
|
704 | fn from<T: ToPrimitive>(n: T) -> Option;
| ^^^^^^^^^^^ required by this bound in num_traits::NumCast::from
help: consider specifying the type argument in the function call
|
524 | y = T::from::(0.75).unwrap() * s;
| +++++
error[E0283]: type annotations needed
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:525:29
|
525 | x = T::from(0.75).unwrap() * s;
| ^^^^^^^ cannot infer type for type {float}
|
= note: multiple impls satisfying {float}: ToPrimitive found in the num_traits crate:
- impl ToPrimitive for f32;
- impl ToPrimitive for f64;
note: required by a bound in num_traits::NumCast::from
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/cast.rs:704:16
|
704 | fn from<T: ToPrimitive>(n: T) -> Option;
| ^^^^^^^^^^^ required by this bound in num_traits::NumCast::from
help: consider specifying the type argument in the function call
|
525 | x = T::from::(0.75).unwrap() * s;
| +++++
error[E0283]: type annotations needed
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/evd.rs:526:29
|
526 | w = T::from(-0.4375).unwrap() * s * s;
| ^^^^^^^ cannot infer type for type {float}
|
= note: multiple impls satisfying {float}: ToPrimitive found in the num_traits crate:
- impl ToPrimitive for f32;
- impl ToPrimitive for f64;
note: required by a bound in num_traits::NumCast::from
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/cast.rs:704:16
|
704 | fn from<T: ToPrimitive>(n: T) -> Option;
| ^^^^^^^^^^^ required by this bound in num_traits::NumCast::from
help: consider specifying the type argument in the function call
|
526 | w = T::from::(-0.4375).unwrap() * s * s;
| +++++
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/svd.rs:119:35
|
119 | g = -s.sqrt().copysign(f);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
119 | g = -num_traits::Float::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
119 | g = -RealNumber::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/svd.rs:155:35
|
155 | g = -s.sqrt().copysign(f);
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
155 | g = -num_traits::Float::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
155 | g = -RealNumber::copysign(s.sqrt(), f);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/linalg/svd.rs:302:59
|
302 | f = ((x - z) * (x + z) + h * ((y / (f + g.copysign(f))) - h)) / x;
| ^^^^^^^^ multiple copysign found
|
note: candidate #1 is defined in the trait num_traits::Float
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/num-traits-0.2.15/src/float.rs:1887:5
|
1887 | fn copysign(self, sign: Self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait RealNumber
--> /Users/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/smartcore-0.2.0/src/math/num.rs:27:5
|
27 | fn copysign(self, sign: Self) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1
|
302 | f = ((x - z) * (x + z) + h * ((y / (f + num_traits::Float::copysign(g, f))) - h)) / x;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
302 | f = ((x - z) * (x + z) + h * ((y / (f + RealNumber::copysign(g, f))) - h)) / x;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~‰`
The text was updated successfully, but these errors were encountered: