Skip to content

Build error with extern crates after upgrading to 2018 edition #56398

Closed
@elliottslaughter

Description

@elliottslaughter

I took my project here and converted it to the 2018 edition: https://github.com/elliottslaughter/integrity-checker

The flow I used was:

git clone https://github.com/elliottslaughter/integrity-checker
cd integrity-checker
cargo +beta fix --edition # no warnings on first try, one change
git commit -a -m 'Prep for edition.'
# go to Cargo.toml and set edition keyword
cargo +beta build

But even though cargo fix completes without warnings, the build is giving me:

   Compiling integrity-checker v0.1.0 (/Users/elliott/Programming/Rust/integrity-checker)                                                   
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)                      
 --> src/error.rs:2:5                                                                                                                       
  |                                                                                                                                         
2 | use ignore;                                                                                                                             
  |     ^^^^^^ not an extern crate passed with `--extern`                                                                                   
  |                                                                                                                                         
note: this import refers to the built-in attribute imported here                                                                            
 --> src/error.rs:2:5                                                                                                                       
  |                                                                                                                                         
2 | use ignore;                                                                                                                             
  |     ^^^^^^                                                                                                                              
                                                                                                                                            
error: aborting due to previous error                                                                                                       
                                                                                                                                            
For more information about this error, try `rustc --explain E0658`.                                                                         
error: Could not compile `integrity-checker`.                                                                                               

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

For posterity I've saved the result of having applied cargo fix here:

https://github.com/elliottslaughter/integrity-checker/tree/rust-2018

$ rustc +beta --version
rustc 1.31.0-beta.20 (8940af3ce 2018-11-30)
$ cargo +beta --version
cargo 1.31.0-beta (339d9f9c8 2018-11-16)

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