Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo fix: failed to upgrade to 2018 edition #6178

Closed
vchekan opened this issue Oct 16, 2018 · 3 comments
Closed

cargo fix: failed to upgrade to 2018 edition #6178

vchekan opened this issue Oct 16, 2018 · 3 comments

Comments

@vchekan
Copy link

vchekan commented Oct 16, 2018

Project I am trying to upgrade to 2018 edition:

git clone [email protected]:vchekan/kafka4rust.git
git checkout 2e06ca51b13d4dc4e1eb2e5ffd4aff8944cdd6fd

I go the following error message. Nnotice, there is no error in the output. (I had to cut it in the middle, otherwise github refuse to accept too long post)

vadim@desktop ~/projects/kafka4rust $ cargo fix --edition 
    Checking kafka4rust v0.1.0 (/home/vadim/projects/kafka4rust)                                                                                                                                                                                                                                                                                                                             
warning: failed to automatically apply fixes suggested by rustc to crate `kafka4rust`                                                                                                                                                                                                                                                                                                        

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

  * src/lib.rs
  * src/protocol/macros.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/cluster.rs:2:5                                                                                                                                                                                                                                                                                                                                                                      
  |                                                                                                                                                                                                                                                                                                                                                                                          
2 | use broker::Broker;                                                                                                                                                                                                                                                                                                                                                                      
  |     ^^^^^^^^^^^^^^ help: use `crate`: `crate::broker::Broker`                                                                                                                                                                                                                                                                                                                            
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/cluster.rs:4:5                                                                                                                                                                                                                                                                                                                                                                      
  |                                                                                                                                                                                                                                                                                                                                                                                          
4 | use connection::BrokerConnection;                                                                                                                                                                                                                                                                                                                                                        
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::connection::BrokerConnection`                                                                                                                                                                                                                                                                                                
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/cluster.rs:7:5                                                                                                                                                                                                                                                                                                                                                                      
  |                                                                                                                                                                                                                                                                                                                                                                                          
7 | use protocol::{MetadataRequest0};                                                                                                                                                                                                                                                                                                                                                        
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::protocol::{MetadataRequest0}`                                                                                                                                                                                                                                                                                                
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/cluster.rs:8:5                                                                                                                                                                                                                                                                                                                                                                      
  |                                                                                                                                                                                                                                                                                                                                                                                          
8 | use protocol::{write_request, read_response, MetadataResponse0};                                                                                                                                                                                                                                                                                                                         
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::protocol::{write_request, read_response, MetadataResponse0}`                                                                                                                                                                                                                                  
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/broker.rs:1:5                                                                                                                                                                                                                                                                                                                                                                       
  |                                                                                                                                                                                                                                                                                                                                                                                          
1 | use connection::BrokerConnection;                                                                                                                                                                                                                                                                                                                                                        
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::connection::BrokerConnection`                                                                                                                                                                                                                                                                                                
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/broker.rs:4:5                                                                                                                                                                                                                                                                                                                                                                       
  |                                                                                                                                                                                                                                                                                                                                                                                          
4 | use protocol;                                                                                                                                                                                                                                                                                                                                                                            
  |     ^^^^^^^^ help: use `crate`: `crate::protocol`                                                                                                                                                                                                                                                                                                                                        
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/connection.rs:9:5                                                                                                                                                                                                                                                                                                                                                                   
  |                                                                                                                                                                                                                                                                                                                                                                                          
9 | use protocol;                                                                                                                                                                                                                                                                                                                                                                            
  |     ^^^^^^^^ help: use `crate`: `crate::protocol`                                                                                                                                                                                                                                                                                                                                        
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
  --> src/connection.rs:10:5                                                                                                                                                                                                                                                                                                                                                                 
   |                                                                                                                                                                                                                                                                                                                                                                                         
10 | use protocol::{write_request, read_response};                                                                                                                                                                                                                                                                                                                                           
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::protocol::{write_request, read_response}`                                                                                                                                                                                                                                                                       
   |                                                                                                                                                                                                                                                                                                                                                                                         
   = 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 TBD                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/protocol/requests.rs:2:5                                                                                                                                                                                                                                                                                                                                                            
  |                                                                                                                                                                                                                                                                                                                                                                                          
2 | use protocol::responses::*;                                                                                                                                                                                                                                                                                                                                                              
  |     ^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::protocol::responses::*`                                                                                                                                                                                                                                                                                                            
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/consumer.rs:2:5                                                                                                                                                                                                                                                                                                                                                                     
  |                                                                                                                                                                                                                                                                                                                                                                                          
2 | use cluster::Cluster;                                                                                                                                                                                                                                                                                                                                                                    
  |     ^^^^^^^^^^^^^^^^ help: use `crate`: `crate::cluster::Cluster`                                                                                                                                                                                                                                                                                                                        
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/consumer.rs:4:5                                                                                                                                                                                                                                                                                                                                                                     
  |                                                                                                                                                                                                                                                                                                                                                                                          
4 | use protocol;                                                                                                                                                                                                                                                                                                                                                                            
  |     ^^^^^^^^ help: use `crate`: `crate::protocol`                                                                                                                                                                                                                                                                                                                                        
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
warning: unused `#[macro_use]` import                                                                                                                                                                                                                                                                                                                                                        
  --> src/lib.rs:23:1                                                                                                                                                                                                                                                                                                                                                                        
   |                                                                                                                                                                                                                                                                                                                                                                                         
23 | #[macro_use] extern crate log;                                                                                                                                                                                                                                                                                                                                                          
   | ^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                                            
   |                                                                                                                                                                                                                                                                                                                                                                                         
   = note: #[warn(unused_imports)] on by default                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                             
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition                                                                                                                                                                                                                                                                              
 --> src/cluster.rs:2:5                                                                                                                                                                                                                                                                                                                                                                      
  |                                                                                                                                                                                                                                                                                                                                                                                          
2 | use broker::Broker;                                                                                                                                                                                                                                                                                                                                                                      
  |     ^^^^^^^^^^^^^^ help: use `crate`: `crate::broker::Broker`                                                                                                                                                                                                                                                                                                                            
  |                                                                                                                                                                                                                                                                                                                                                                                          
  = 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 TBD                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                             
...
...
...
...
...
                                                                                                                                                                                                                                                                                                                                                                                         
warning: method is never used: `on_message`                                                                                                                                                                                                                                                                                                                                                  
  --> src/consumer.rs:38:5                                                                                                                                                                                                                                                                                                                                                                   
   |                                                                                                                                                                                                                                                                                                                                                                                         
38 |     pub fn on_message(mut self) -> impl Stream<Item=Vec<Message>, Error=()> {                                                                                                                                                                                                                                                                                                           
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                             
warning: method is never used: `connect_brokers`                                                                                                                                                                                                                                                                                                                                             
  --> src/consumer.rs:60:5                                                                                                                                                                                                                                                                                                                                                                   
   |                                                                                                                                                                                                                                                                                                                                                                                         
60 |     fn connect_brokers(meta: protocol::MetadataResponse0) {                                                                                                                                                                                                                                                                                                                             
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                             
warning: method is never used: `connect_broker`                                                                                                                                                                                                                                                                                                                                              
  --> src/consumer.rs:65:5                                                                                                                                                                                                                                                                                                                                                                   
   |                                                                                                                                                                                                                                                                                                                                                                                         
65 |     fn connect_broker(broker: &protocol::Broker) {                                                                                                                                                                                                                                                                                                                                      
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                                                                             
warning: structure field `correlationId` should have a snake case name such as `correlation_id`                                                                                                                                                                                                                                                                                              
  --> src/connection.rs:18:5                                                                                                                                                                                                                                                                                                                                                                 
   |                                                                                                                                                                                                                                                                                                                                                                                         
18 |     correlationId: u32,                                                                                                                                                                                                                                                                                                                                                                 
   |     ^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                                  
   |                                                                                                                                                                                                                                                                                                                                                                                         
   = note: #[warn(non_snake_case)] on by default                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                             
    Finished dev [unoptimized + debuginfo] target(s) in 0.88s   
@alexcrichton
Copy link
Member

Thanks for the report! I've minimized this and I believe it's a case of #5738 where cargo fix is attempting to fix unused variables but the macros in use here mean that the fix is breaking code accidentally.

If you change these two lines to both reference _buff then the fix --edition call will work.

I'm gonna close this in favor of #5738 to centralize discussion, but it'd still be good for us to fix this!

@vchekan
Copy link
Author

vchekan commented Oct 16, 2018

@alexcrichton thank you for looking into it.
I have to note though, that error message was intermittent. I remember seeing it once or twice, but most of the time I could see only warnings but no errors. Would it be another bug?

@alexcrichton
Copy link
Member

If you can narrow it down, sure yeah! It'd be good to get it reproducible though to make sure we can track it down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants