rustpotter icon indicating copy to clipboard operation
rustpotter copied to clipboard

could not compile candle-core

Open godspeedee opened this issue 7 months ago • 1 comments

I created a new project, just added rustpotter to the dependencies and caught error:

error[E0277]: the trait bound `half::bf16: SampleBorrow<half::bf16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2618:55
     |
2618 |                     rand::distributions::Uniform::new(bf16::from_f64(min), bf16::from_f64(max));
     |                     --------------------------------- ^^^^^^^^^^^^^^^^^^^ the trait `SampleUniform` is not implemented for `half::bf16`
     |                     |
     |                     required by a bound introduced by this call
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/bfloat.rs:50:1
     |
50   | pub struct bf16(u16);
     | --------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
     = note: required for `half::bf16` to implement `SampleBorrow<half::bf16>`
note: required by a bound in `Uniform::<X>::new`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:186:13
     |
184  |     pub fn new<B1, B2>(low: B1, high: B2) -> Uniform<X>
     |            --- required by a bound in this associated function
185  |     where
186  |         B1: SampleBorrow<X> + Sized,
     |             ^^^^^^^^^^^^^^^ required by this bound in `Uniform::<X>::new`

error[E0277]: the trait bound `half::bf16: SampleBorrow<half::bf16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2618:76
     |
2618 |                     rand::distributions::Uniform::new(bf16::from_f64(min), bf16::from_f64(max));
     |                     ---------------------------------                      ^^^^^^^^^^^^^^^^^^^ the trait `SampleUniform` is not implemented for `half::bf16`
     |                     |
     |                     required by a bound introduced by this call
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/bfloat.rs:50:1
     |
50   | pub struct bf16(u16);
     | --------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
     = note: required for `half::bf16` to implement `SampleBorrow<half::bf16>`
note: required by a bound in `Uniform::<X>::new`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:187:13
     |
184  |     pub fn new<B1, B2>(low: B1, high: B2) -> Uniform<X>
     |            --- required by a bound in this associated function
...
187  |         B2: SampleBorrow<X> + Sized,
     |             ^^^^^^^^^^^^^^^ required by this bound in `Uniform::<X>::new`

error[E0277]: the trait bound `half::bf16: SampleUniform` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2618:21
     |
2618 |                     rand::distributions::Uniform::new(bf16::from_f64(min), bf16::from_f64(max));
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SampleUniform` is not implemented for `half::bf16`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/bfloat.rs:50:1
     |
50   | pub struct bf16(u16);
     | --------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `Uniform`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:179:23
     |
179  | pub struct Uniform<X: SampleUniform>(X::Sampler);
     |                       ^^^^^^^^^^^^^ required by this bound in `Uniform`

error[E0277]: the trait bound `half::bf16: SampleUniform` is not satisfied in `Uniform<half::bf16>`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2617:21
     |
2617 |                 let uniform =
     |                     ^^^^^^^ within `Uniform<half::bf16>`, the trait `SampleUniform` is not implemented for `half::bf16`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/bfloat.rs:50:1
     |
50   | pub struct bf16(u16);
     | --------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required because it appears within the type `Uniform<half::bf16>`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:179:12
     |
179  | pub struct Uniform<X: SampleUniform>(X::Sampler);
     |            ^^^^^^^
     = note: all local variables must have a statically known size
     = help: unsized locals are gated as an unstable feature

error[E0277]: the trait bound `half::bf16: SampleUniform` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2620:50
     |
2620 |                     data.push(rng.sample::<bf16, _>(uniform))
     |                                                  ^ the trait `SampleUniform` is not implemented for `half::bf16`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/bfloat.rs:50:1
     |
50   | pub struct bf16(u16);
     | --------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `Uniform`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:179:23
     |
179  | pub struct Uniform<X: SampleUniform>(X::Sampler);
     |                       ^^^^^^^^^^^^^ required by this bound in `Uniform`

error[E0277]: the trait bound `half::f16: SampleBorrow<half::f16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2627:55
     |
2627 |                     rand::distributions::Uniform::new(f16::from_f64(min), f16::from_f64(max));
     |                     --------------------------------- ^^^^^^^^^^^^^^^^^^ the trait `SampleUniform` is not implemented for `half::f16`
     |                     |
     |                     required by a bound introduced by this call
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/binary16.rs:50:1
     |
50   | pub struct f16(u16);
     | -------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
     = note: required for `half::f16` to implement `SampleBorrow<half::f16>`
note: required by a bound in `Uniform::<X>::new`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:186:13
     |
184  |     pub fn new<B1, B2>(low: B1, high: B2) -> Uniform<X>
     |            --- required by a bound in this associated function
185  |     where
186  |         B1: SampleBorrow<X> + Sized,
     |             ^^^^^^^^^^^^^^^ required by this bound in `Uniform::<X>::new`

error[E0277]: the trait bound `half::f16: SampleBorrow<half::f16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2627:75
     |
2627 |                     rand::distributions::Uniform::new(f16::from_f64(min), f16::from_f64(max));
     |                     ---------------------------------                     ^^^^^^^^^^^^^^^^^^ the trait `SampleUniform` is not implemented for `half::f16`
     |                     |
     |                     required by a bound introduced by this call
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/binary16.rs:50:1
     |
50   | pub struct f16(u16);
     | -------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
     = note: required for `half::f16` to implement `SampleBorrow<half::f16>`
note: required by a bound in `Uniform::<X>::new`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:187:13
     |
184  |     pub fn new<B1, B2>(low: B1, high: B2) -> Uniform<X>
     |            --- required by a bound in this associated function
...
187  |         B2: SampleBorrow<X> + Sized,
     |             ^^^^^^^^^^^^^^^ required by this bound in `Uniform::<X>::new`

error[E0277]: the trait bound `half::f16: SampleUniform` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2627:21
     |
2627 |                     rand::distributions::Uniform::new(f16::from_f64(min), f16::from_f64(max));
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SampleUniform` is not implemented for `half::f16`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/binary16.rs:50:1
     |
50   | pub struct f16(u16);
     | -------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `Uniform`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:179:23
     |
179  | pub struct Uniform<X: SampleUniform>(X::Sampler);
     |                       ^^^^^^^^^^^^^ required by this bound in `Uniform`

error[E0277]: the trait bound `half::f16: SampleUniform` is not satisfied in `Uniform<half::f16>`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2626:21
     |
2626 |                 let uniform =
     |                     ^^^^^^^ within `Uniform<half::f16>`, the trait `SampleUniform` is not implemented for `half::f16`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/binary16.rs:50:1
     |
50   | pub struct f16(u16);
     | -------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required because it appears within the type `Uniform<half::f16>`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:179:12
     |
179  | pub struct Uniform<X: SampleUniform>(X::Sampler);
     |            ^^^^^^^
     = note: all local variables must have a statically known size
     = help: unsized locals are gated as an unstable feature

error[E0277]: the trait bound `half::f16: SampleUniform` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2629:49
     |
2629 |                     data.push(rng.sample::<f16, _>(uniform))
     |                                                 ^ the trait `SampleUniform` is not implemented for `half::f16`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:216:1
     |
216  | pub trait SampleUniform: Sized {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/half-2.6.0/src/binary16.rs:50:1
     |
50   | pub struct f16(u16);
     | -------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `Uniform`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/uniform.rs:179:23
     |
179  | pub struct Uniform<X: SampleUniform>(X::Sampler);
     |                       ^^^^^^^^^^^^^ required by this bound in `Uniform`

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::bf16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2663:30
     |
2663 |                 let normal = rand_distr::Normal::new(bf16::from_f64(mean), bf16::from_f64(std))
     |                              ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_distr::Distribution<half::bf16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal::<F>::new`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:147:33
     |
147  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal::<F>::new`
...
156  |     pub fn new(mean: F, std_dev: F) -> Result<Normal<F>, Error> {
     |            --- required by a bound in this associated function

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::bf16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2663:30
     |
2663 |                 let normal = rand_distr::Normal::new(bf16::from_f64(mean), bf16::from_f64(std))
     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_distr::Distribution<half::bf16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:118:33
     |
117  | pub struct Normal<F>
     |            ------ required by a bound in this struct
118  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal`

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::bf16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2663:30
     |
2663 |                   let normal = rand_distr::Normal::new(bf16::from_f64(mean), bf16::from_f64(std))
     |  ______________________________^
2664 | |                     .map_err(Error::wrap)?;
     | |_________________________________________^ the trait `rand_distr::Distribution<half::bf16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:118:33
     |
117  | pub struct Normal<F>
     |            ------ required by a bound in this struct
118  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal`

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::bf16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2663:30
     |
2663 |                   let normal = rand_distr::Normal::new(bf16::from_f64(mean), bf16::from_f64(std))
     |  ______________________________^
2664 | |                     .map_err(Error::wrap)?;
     | |__________________________________________^ the trait `rand_distr::Distribution<half::bf16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:118:33
     |
117  | pub struct Normal<F>
     |            ------ required by a bound in this struct
118  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal`

error[E0599]: the method `sample` exists for struct `Normal<bf16>`, but its trait bounds were not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2666:38
     |
2666 |                     data.push(normal.sample(&mut rng))
     |                                      ^^^^^^ method cannot be called on `Normal<bf16>` due to unsatisfied trait bounds
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- doesn't satisfy `_: Distribution<bf16>`
...
117  | pub struct Normal<F>
     | -------------------- doesn't satisfy `_: Distribution<bf16>`, `rand_distr::Normal<half::bf16>: RngCore` or `rand_distr::Normal<half::bf16>: rand::Rng`
     |
     = note: the following trait bounds were not satisfied:
             `StandardNormal: rand_distr::Distribution<half::bf16>`
             which is required by `rand_distr::Normal<half::bf16>: rand_distr::Distribution<half::bf16>`
             `rand_distr::Normal<half::bf16>: RngCore`
             which is required by `rand_distr::Normal<half::bf16>: rand::Rng`

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::f16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2672:30
     |
2672 |                 let normal = rand_distr::Normal::new(f16::from_f64(mean), f16::from_f64(std))
     |                              ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_distr::Distribution<half::f16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal::<F>::new`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:147:33
     |
147  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal::<F>::new`
...
156  |     pub fn new(mean: F, std_dev: F) -> Result<Normal<F>, Error> {
     |            --- required by a bound in this associated function

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::f16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2672:30
     |
2672 |                 let normal = rand_distr::Normal::new(f16::from_f64(mean), f16::from_f64(std))
     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_distr::Distribution<half::f16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:118:33
     |
117  | pub struct Normal<F>
     |            ------ required by a bound in this struct
118  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal`

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::f16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2672:30
     |
2672 |                   let normal = rand_distr::Normal::new(f16::from_f64(mean), f16::from_f64(std))
     |  ______________________________^
2673 | |                     .map_err(Error::wrap)?;
     | |_________________________________________^ the trait `rand_distr::Distribution<half::f16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:118:33
     |
117  | pub struct Normal<F>
     |            ------ required by a bound in this struct
118  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal`

error[E0277]: the trait bound `StandardNormal: rand_distr::Distribution<half::f16>` is not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2672:30
     |
2672 |                   let normal = rand_distr::Normal::new(f16::from_f64(mean), f16::from_f64(std))
     |  ______________________________^
2673 | |                     .map_err(Error::wrap)?;
     | |__________________________________________^ the trait `rand_distr::Distribution<half::f16>` is not implemented for `StandardNormal`
     |
note: there are multiple different versions of crate `rand` in the dependency graph
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.8.5/src/distributions/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^ this is the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2607:13
     |
2607 |         use rand::prelude::*;
     |             ---- one version of crate `rand` used here, as a direct dependency of the current crate
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/convert.rs:3:5
     |
3    | use half::{bf16, f16, slice::HalfFloatSliceExt};
     |     ---- one version of crate `rand` used here, as a dependency of crate `half`
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- this type doesn't implement the required trait
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand-0.9.1/src/distr/distribution.rs:35:1
     |
35   | pub trait Distribution<T> {
     | ------------------------- this is the found trait
     = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `rand_distr::Normal`
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:118:33
     |
117  | pub struct Normal<F>
     |            ------ required by a bound in this struct
118  | where F: Float, StandardNormal: Distribution<F>
     |                                 ^^^^^^^^^^^^^^^ required by this bound in `Normal`

error[E0599]: the method `sample` exists for struct `Normal<f16>`, but its trait bounds were not satisfied
    --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/candle-core-0.2.2/src/cpu_backend.rs:2675:38
     |
2675 |                     data.push(normal.sample(&mut rng))
     |                                      ^^^^^^ method cannot be called on `Normal<f16>` due to unsatisfied trait bounds
     |
    ::: /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rand_distr-0.4.3/src/normal.rs:41:1
     |
41   | pub struct StandardNormal;
     | ------------------------- doesn't satisfy `_: Distribution<f16>`
...
117  | pub struct Normal<F>
     | -------------------- doesn't satisfy `_: Distribution<f16>`, `rand_distr::Normal<half::f16>: RngCore` or `rand_distr::Normal<half::f16>: rand::Rng`
     |
     = note: the following trait bounds were not satisfied:
             `StandardNormal: rand_distr::Distribution<half::f16>`
             which is required by `rand_distr::Normal<half::f16>: rand_distr::Distribution<half::f16>`
             `rand_distr::Normal<half::f16>: RngCore`
             which is required by `rand_distr::Normal<half::f16>: rand::Rng`

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.

godspeedee avatar May 22 '25 19:05 godspeedee

Same problem here. Haven't found a fix...

XanderTheDev avatar Nov 17 '25 20:11 XanderTheDev

It uses outdated candle-core/candle-nn. I made a PR with a fixed code to support newer version.

Priler avatar Dec 11 '25 20:12 Priler