Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

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

Open
epage opened this issue Dec 2, 2021 · 1 comment
Open

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

epage opened this issue Dec 2, 2021 · 1 comment

Comments

@epage
Copy link

epage commented Dec 2, 2021

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
  • Pretty much everything for types is missing.
  • SubCommand is not new

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

@scrabsha
Copy link
Contributor

scrabsha commented Dec 2, 2021

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)

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

No branches or pull requests

2 participants