iomentum / cargo-breaking

Mozilla Public License 2.0
112 stars 7 forks source link

Comparing clap v2 against v3 missses a lot of changes #41

Open epage opened 2 years ago

epage commented 2 years ago

No idea if this will be addressed by the rustc-backend branch but I thought I'd still report this.

Note that to reproduce this with cargo-breaking's main branch, you need to patch clap v2-master because apparently rust allows traits functions to not name variables but syn requires it? (span-locations proc-macro2 feature flag and reporting line/column is a big debugging help)

Output:

❯ cargo breaking -a v2-patch                               
Current                                                   
Previous                                                                                                             
- app::help::term_size::dimensions                        
- app::usage::create_error_usage                                                                                     
- app::usage::create_help_usage                           
- app::usage::create_usage_no_title                                                                                  
- app::usage::create_usage_with_title                     
- app::usage::get_required_usage_from                                                                                
- completions::all_subcommand_names                       
- completions::all_subcommands                                                                                       
- completions::get_all_subcommand_paths                                                                              
- completions::subcommands_of                                                                                        
- fmt::is_a_tty                                           
- fmt::is_term_dumb                                       
- suggestions::did_you_mean                                                                                          
- suggestions::did_you_mean_flag_suffix                                                                              
- suggestions::did_you_mean_value_suffix                                                                             
+ SubCommand                                                                                                         
+ SubCommand::with_name                                   

Warning: cargo-breaking does not handle pre-release identifiers                                                      
Next version is: 4.0.0

My guess is that cargo-breaking is not taking into account items defined in private modules that are re-exported in public modules.

scrabsha commented 2 years ago

My guess is that cargo-breaking is not taking into account items defined in private modules that are re-exported in public modules.

Correct! This is something i completely forgot when writing the algorithm which is currently on main. IIRC i did the same on the rustc-backend. Additionally, the main branch does not handle pub use items. This is something that IMO deserves to be addressed at least on the rustc-backend branch.

This may not be the only source of missing diagnostic though.

(honestly i'm impressed we produced some diagnostics for real-world code)