{"id":312,"hash":"77de788ff0f94bf55c35b31078e72e2c616c221b4d2dcb5b7fb08428b0429db3","pattern":"Compilation error: can&#39;t find crate for `core`","full_message":"I'm using Rust 1.35.0 to try out some Rust examples and I could not get it to compile, as I keep getting the following message:\n\nerror[E0463]: can't find crate for `core`\n\nI ran rustc --explain E0463 and I see the following message:\n\nYou need to link your code to the relevant crate in order to be able to use it\n(through Cargo or the `-L` option of rustc example). Plugins are crates as\nwell, and you link to them the same way.\n\nHere is my Cargo.toml:\n\n[package]\nname = \"sensor-node\"\nversion = \"0.1.0\"\nauthors = [\"joesan <email@gmail.com>\"]\nedition = \"2018\"\n\n[dependencies]\ndwm1001 = \"0.1.0\"\npanic-halt = \"0.2.0\"\nnb = \"0.1.1\"\n\nHere is my main.rs:\n\nfn main() {\n    let s = String::from(\"hello\");  // s comes into scope\n\n    takes_ownership(s);             // s's value moves into the function...\n                                    // ... and so is no longer valid here\n\n    let x = 5;                      // x comes into scope\n\n    makes_copy(x);                  // x would move into the function,\n                                    // but i32 is Copy, so it’s okay to still\n                                    // use x afterward\n\n} // Here, x goes out of scope, then s. But because s's value was moved, nothing\n  // special happens.\n\nfn takes_ownership(some_string: String) { // some_string comes into scope\n    println!(\"{}\", some_string);\n} // Here, some_string goes out of scope and `drop` is called. The backing\n  // memory is freed.\n\nfn makes_copy(some_integer: i32) { // some_integer comes into scope\n    println!(\"{}\", some_integer);\n} // Here, some_integer goes out of scope. Nothing special happens.","ecosystem":"cargo","package_name":"rust-cargo","package_version":null,"solution":"Your code works fine on the Rust playground, so I recommend checking your Rust installation and environment settings.\n\nYou may want to use the preconfigured Rust Docker image to run your app. Have Docker installed, then:  \n\ndocker pull rust\n\nGo to your project folder and run:\n\ndocker run --rm --user \"$(id -u)\":\"$(id -g)\" -v \"$PWD\":/usr/src/myapp -w /usr/src/myapp rust cargo run\n\nOutput:\n\nhello\n5\n\nFor your simple example on a PC, you don't need any of these dependencies:\n\n[dependencies]\ndwm1001 = \"0.1.0\"\npanic-halt = \"0.2.0\"\nnb = \"0.1.1\"\n\nHere are my steps to test your sample on Linux:\n\ncargo new hello\ncd hello\ncode .\n\nOpen main.rs and paste your sample main.rs and save:\n\nfn main() {\n    let s = String::from(\"hello\"); // s comes into scope\n\n    takes_ownership(s); // s's value moves into the function...\n                        // ... and so is no longer valid here\n\n    let x = 5; // x comes into scope\n\n    makes_copy(x); // x would move into the function,\n                   // but i32 is Copy, so it’s okay to still\n                   // use x afterward\n} // Here, x goes out of scope, then s. But because s's value was moved, nothing\n  // special happens.\n\nfn takes_ownership(some_string: String) {\n    // some_string comes into scope\n    println!(\"{}\", some_string);\n} // Here, some_string goes out of scope and `drop` is called. The backing\n  // memory is freed.\n\nfn makes_copy(some_integer: i32) {\n    // some_integer comes into scope\n    println!(\"{}\", some_integer);\n} // Here, some_integer goes out of scope. Nothing special happens.\n\nIn a terminal inside the hello folder, run:\n\ncargo run\n\nAnd the output is good:\n\nhello\n5\n\nThis may help:  \n\nShell command\n\nrustup component list --installed\n\nOutput:\n\ncargo-x86_64-unknown-linux-gnu\nclippy-x86_64-unknown-linux-gnu\nrls-x86_64-unknown-linux-gnu\nrust-analysis-x86_64-unknown-linux-gnu\nrust-docs-x86_64-unknown-linux-gnu\nrust-src\nrust-std-x86_64-unknown-linux-gnu\nrustc-x86_64-unknown-linux-gnu\nrustfmt-x86_64-unknown-linux-gnu\n\nShell command:\n\nrustup show\n\nOutput:\n\nDefault host: x86_64-unknown-linux-gnu\n\ninstalled toolchains\n--------------------\n\nstable-x86_64-unknown-linux-gnu (default)\nnightly-x86_64-unknown-linux-gnu\n\nactive toolchain\n----------------\n\nstable-x86_64-unknown-linux-gnu (default)\nrustc 1.35.0 (3c235d560 2019-05-20)","confidence":0.7000000000000001,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/56389460/compilation-error-cant-find-crate-for-core","votes":27,"created_at":"2026-04-19T04:41:50.438133+00:00","updated_at":"2026-04-19T04:52:30.367319+00:00"}