Skip to content

Compile message contains reference to an identifier not used by the erraneous code #63852

Closed
@svenschmidt75

Description

@svenschmidt75

rustc 1.37.0 (eae3437 2019-08-13)

Repo: https://github.com/svenschmidt75/Rust
Commit: svenschmidt75/Rust@23ec342

When building, I get error message

   Compiling ann v0.1.0 (/home/svenschmidt75/Develop/Rust/NeuralNetwork/lib/ann)
error[E0282]: type annotations needed
  --> lib/ann/src/ann/cost_function.rs:25:9
   |
25 |         diff2.iter().sum() as f64 / 2.0
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S`
   |
   = note: type must be known at this point

error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
error: Could not compile `ann`.
warning: build failed, waiting for other jobs to finish...
error[E0282]: type annotations needed
  --> lib/ann/src/ann/cost_function.rs:25:9
   |
25 |         diff2.iter().sum() as f64 / 2.0
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S`
   |
   = note: type must be known at this point

error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
error: Could not compile `ann`.

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

Process finished with exit code 101

Where does S come from?

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-inferenceArea: Type inferenceC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions