@@ -13,6 +13,7 @@ use std::env;
13
13
use std:: iter;
14
14
use std:: path:: PathBuf ;
15
15
use std:: process:: { Command , exit} ;
16
+ use std:: collections:: HashSet ;
16
17
17
18
use Mode ;
18
19
use Compiler ;
@@ -183,12 +184,29 @@ impl Step for ToolBuild {
183
184
typically means that something was recompiled because \
184
185
a transitive dependency has different features activated \
185
186
than in a previous build:\n ") ;
187
+ println ! ( "the following dependencies are duplicated although they \
188
+ have the same features enabled:") ;
189
+ for ( id, cur, prev) in & duplicates {
190
+ println ! ( " {}" , id) ;
191
+ if cur. 2 == prev. 2 {
192
+ // same features
193
+ println ! ( " `{}` ({:?})\n `{}` ({:?})" , cur. 0 , cur. 1 , prev. 0 , prev. 1 ) ;
194
+ }
195
+ }
196
+ println ! ( "the following dependencies have different features:" ) ;
186
197
for ( id, cur, prev) in duplicates {
187
198
println ! ( " {}" , id) ;
188
- println ! ( " `{}` enabled features {:?} at {:?}" ,
189
- cur. 0 , cur. 2 , cur. 1 ) ;
190
- println ! ( " `{}` enabled features {:?} at {:?}" ,
191
- prev. 0 , prev. 2 , prev. 1 ) ;
199
+ if cur. 2 == prev. 2 {
200
+ continue ;
201
+ }
202
+ let cur_features: HashSet < _ > = cur. 2 . into_iter ( ) . collect ( ) ;
203
+ let prev_features: HashSet < _ > = prev. 2 . into_iter ( ) . collect ( ) ;
204
+ let cur_extra: Vec < _ > = cur_features. difference ( & prev_features) . collect ( ) ;
205
+ let prev_extra: Vec < _ > = prev_features. difference ( & cur_features) . collect ( ) ;
206
+ println ! ( " `{}` additionally enabled features {:?} at {:?}" ,
207
+ cur. 0 , cur_extra, cur. 1 ) ;
208
+ println ! ( " `{}` additionally enabled features {:?} at {:?}" ,
209
+ prev. 0 , prev_extra, prev. 1 ) ;
192
210
}
193
211
println ! ( "" ) ;
194
212
panic ! ( "tools should not compile multiple copies of the same crate" ) ;
0 commit comments