Skip to content

error: type annotations required: cannot resolve <f32 as core::ops::Add<_>>::Output == f32 [E0284] #38

@andersk

Description

@andersk

With today’s rust-nightly (rust-lang/rust@6cf3b0b), rand no longer builds. It was fine in yesterday’s nightly (rust-lang/rust@d8be84e), so I’m guessing the difference is due to rust-lang/rust#23673.

$ rustc --version
rustc 1.0.0-dev (built 2015-03-31)
$ cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.1.4
   Compiling log v0.3.1
   Compiling rand v0.3.3 (file:///home/anders/rust/rand)
src/distributions/range.rs:156:17: 156:44 error: type annotations required: cannot resolve `<f32 as core::ops::Add<_>>::Output == f32` [E0284]
src/distributions/range.rs:156                 r.low + r.range * rng.gen()
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/distributions/range.rs:145:1: 160:2 note: in expansion of float_impl!
src/distributions/range.rs:162:1: 162:20 note: expansion site
error: aborting due to previous error
Could not compile `rand`.

To learn more, run the command again with --verbose.

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