Skip to content

Cargo fix fails to apply --edition to block-utils crate #6413

Closed
@cholcombe973

Description

@cholcombe973

I tried to use cargo fix --edition to upgrade my block-utils crate to the 2018 edition. It fails to apply and gives output suggesting I file a bug so here i am :)

Steps

  1. Checkout master of https://github.com/cholcombe973/block-utils
  2. run cargo fix --edition against it.
  3. Patch fails to apply

Possible Solution(s)

Notes

cargo fix --edition --allow-dirty
    Checking block-utils v0.6.0 (/home/chris/repos/block-utils)                                                                                                        
warning: failed to automatically apply fixes suggested by rustc to crate `block_utils`                                                                                 

after fixes were automatically applied the compiler reported errors within these files:

  * src/lib.rs

This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see 
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/cargo/issues
quoting the full output of this command we'd be very appreciative!

warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                        
 --> src/nvme.rs:5:5                                                                                                                                                   
  |                                                                                                                                                                    
5 | use {BlockResult, BlockUtilsError};                                                                                                                                
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{BlockResult, BlockUtilsError}`                                                                      
  |                                                                                                                                                                    
  = note: `-W absolute-paths-not-starting-with-crate` implied by `-W rust-2018-compatibility`                                                                          
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!                                    
  = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>                                                                      
                                                                                                                                                                       
warning: unused variable: `e`                                                                                                                                          
    --> src/lib.rs:1520:33                                                                                                                                             
     |                                                                                                                                                                 
1520 |             Err(nom::Err::Error(e)) | Err(nom::Err::Failure(e)) => Err(BlockUtilsError::new(                                                                    
     |                                 ^ help: consider using `_e` instead                                                                                             
     |                                                                                                                                                                 
     = note: #[warn(unused_variables)] on by default                                                                                                                   
                                                                                                                                                                       
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                        
 --> src/nvme.rs:5:5                                                                                                                                                   
  |                                                                                                                                                                    
5 | use {BlockResult, BlockUtilsError};                                                                                                                                
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{BlockResult, BlockUtilsError}`                                                                      
  |                                                                                                                                                                    
  = note: `-W absolute-paths-not-starting-with-crate` implied by `-W rust-2018-compatibility`                                                                          
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!                                    
  = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>                                                                      
                                                                                                                                                                       
warning: unused variable: `e`                                                                                                                                          
    --> src/lib.rs:1520:33                                                                                                                                             
     |                                                                                                                                                                 
1520 |             Err(nom::Err::Error(e)) | Err(nom::Err::Failure(e)) => Err(BlockUtilsError::new(                                                                    
     |                                 ^ help: consider using `_e` instead                                                                                             
     |                                                                                                                                                                 
     = note: #[warn(unused_variables)] on by default                                                                                                                   
                                                                                                                                                                       
    Finished dev [unoptimized + debuginfo] target(s) in 5.56s  

Output of cargo version: cargo 1.31.0 (339d9f9 2018-11-16)

rustc --version
rustc 1.31.0 (abe02cefd 2018-12-04)

running on Ubuntu 16.04.4 LTS

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