Imports can only refer to extern crate names


I git cloned my project that worked on a different computer the same day, but when I compile it on the new computer I get:

error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
  --> src/
22 | mod fetch;
   | ---------- not an extern crate passed with `--extern`
23 | 
24 | use fetch::jobs::run_job;
   |     ^^^^^
   = help: add #![feature(uniform_paths)] to the crate attributes to enable
note: this import refers to the module defined here
  --> src/
22 | mod fetch;
   | ^^^^^^^^^^

here is my dir:

β”œβ”€β”€ bin
β”‚   β”œβ”€β”€
β”‚   β”œβ”€β”€
β”‚   └──
β”œβ”€β”€ db
β”‚   β”œβ”€β”€
β”‚   β”œβ”€β”€
β”‚   β”œβ”€β”€
β”‚   β”œβ”€β”€
β”‚   └──
β”œβ”€β”€ fetch
β”‚   β”œβ”€β”€
β”‚   β”œβ”€β”€
β”‚   β”œβ”€β”€
β”‚   β”œβ”€β”€
β”‚   └──

here is how my main looks like:

mod fetch;

use fetch::jobs::run_job;

fn main() {
    run_job("".into(), 4);

and here is the fetch/

pub mod sources;
pub mod jobs;
pub mod process;

If you’re using version 1.29 <= rust <= 1.31 then what you need to do is use self::module_defined_here instead. I’d recommend updating though as this was sorted out in rust 1.32 so just go to a terminal and rustup update.


rustc 1.32.0-nightly (f4a421ee3 2018-12-13)


This is the one I am using and it is giving me that error


well, I am using cargo:

cargo 1.33.0-nightly (28fb20034 2018-12-09)


yeah it works with the self

1 Like

looks like it was fixed 7 days ago
your nightly is from 13 dec. 2018 though.



stable rust is 01-16-19 but nightly is still from december. I thought nightly was always ahead?


also I get an error on nightly update:

[ Sat Jan 19 | 08:38 PM | forecast-service ]: rustup update && cargo update
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: syncing channel updates for 'nightly-x86_64-apple-darwin'
info: latest update on 2019-01-20, rust version 1.33.0-nightly (0c0c58528 2019-01-19)
error: component 'rls' for target 'x86_64-apple-darwin' is unavailable for download
info: checking for self-updates

       stable-x86_64-apple-darwin unchanged - rustc 1.32.0 (9fda7c223 2019-01-16)
  nightly-x86_64-apple-darwin update failed - rustc 1.32.0-nightly (f4a421ee3 2018-12-13)


Sometimes, due to the way tools are structured in Rust, they lag behind rustc updates. Rustup does its best to avoid automatically updating you to a toolchain missing a component that you’ve added, so you’ll either want to tell it to do so anyway (I’m actually not sure how) or just wait for the toolstate to be unbroken. You did the right thing filing an issue to track it, since I can’t find another. (Adding a link to the rollup which broke the RLS might be helpful as well.)

1 Like