rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.34k stars 12.72k forks source link

cannot find crate #61463

Open svenschmidt75 opened 5 years ago

svenschmidt75 commented 5 years ago

Rust compiler:

rustup show Default host: x86_64-unknown-linux-gnu

stable-x86_64-unknown-linux-gnu (default) rustc 1.35.0 (3c235d560 2019-05-20)

Project: https://github.com/svenschmidt75/Rust, commit 78b9a8fd4740bbf8630cc0ade48346a5387f2075, authored 6/2/2019 @ 8:58 AM

File model.rs, line 139,

...
                    mb.a[0] = training_sample.input_activations.clone();
                    self.feedforward(mb);
                    self.backprop(mb, cost_function, known_classification);
                }
                let (dws, dbs) = self.calculate_derivatives(&mbs[..], lambda);
                self.apply_momentum(eta, rho, dws, dbs);
                self.update_network();
            }
...

Replace eta with meta and compile. The error refers to a missing crate which I found odd:

   Compiling ann v0.1.0 (/home/svenschmidt75/Develop/Rust/NeuralNetwork/lib/ann)
error[E0463]: can't find crate for `meta`
   --> lib/ann/src/ann/model.rs:139:37
    |
139 |                 self.apply_momentum(meta, rho, dws, dbs);
    |                                     ^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `ann`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `meta`
   --> lib/ann/src/ann/model.rs:139:37
    |
139 |                 self.apply_momentum(meta, rho, dws, dbs);
    |                                     ^^^^ can't find crate

error: aborting due to previous error

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

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

Process finished with exit code 101
jonas-schievink commented 5 years ago

Reproduction:

let xyz = meta;

(ie. this happens to any occurrence of a nonexistent local meta)

Expected outcome would be error[E0425]: cannot find value `meta` in this scope

Centril commented 5 years ago

Not a bug. See https://github.com/rust-lang/rust/pull/54116. The crate meta is reserved in the extern prelude in case we want to use it in the future for proc macros and so on.