Skip to content

Commit 3395094

Browse files
committed
bootstrap: don't emit warn about duplicated deps with same/different features, if some of lists actually empty
1 parent 05e678c commit 3395094

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

src/bootstrap/tool.rs

+28-24
Original file line numberDiff line numberDiff line change
@@ -158,34 +158,38 @@ impl Step for ToolBuild {
158158
a transitive dependency has different features activated \
159159
than in a previous build:\n"
160160
);
161-
eprintln!(
162-
"the following dependencies are duplicated although they \
163-
have the same features enabled:"
164-
);
165161
let (same, different): (Vec<_>, Vec<_>) =
166162
duplicates.into_iter().partition(|(_, cur, prev)| cur.2 == prev.2);
167-
for (id, cur, prev) in same {
168-
eprintln!(" {}", id);
169-
// same features
170-
eprintln!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1);
171-
}
172-
eprintln!("the following dependencies have different features:");
173-
for (id, cur, prev) in different {
174-
eprintln!(" {}", id);
175-
let cur_features: HashSet<_> = cur.2.into_iter().collect();
176-
let prev_features: HashSet<_> = prev.2.into_iter().collect();
177-
eprintln!(
178-
" `{}` additionally enabled features {:?} at {:?}",
179-
cur.0,
180-
&cur_features - &prev_features,
181-
cur.1
182-
);
163+
if !same.is_empty() {
183164
eprintln!(
184-
" `{}` additionally enabled features {:?} at {:?}",
185-
prev.0,
186-
&prev_features - &cur_features,
187-
prev.1
165+
"the following dependencies are duplicated although they \
166+
have the same features enabled:"
188167
);
168+
for (id, cur, prev) in same {
169+
eprintln!(" {}", id);
170+
// same features
171+
eprintln!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1);
172+
}
173+
}
174+
if !different.is_empty() {
175+
eprintln!("the following dependencies have different features:");
176+
for (id, cur, prev) in different {
177+
eprintln!(" {}", id);
178+
let cur_features: HashSet<_> = cur.2.into_iter().collect();
179+
let prev_features: HashSet<_> = prev.2.into_iter().collect();
180+
eprintln!(
181+
" `{}` additionally enabled features {:?} at {:?}",
182+
cur.0,
183+
&cur_features - &prev_features,
184+
cur.1
185+
);
186+
eprintln!(
187+
" `{}` additionally enabled features {:?} at {:?}",
188+
prev.0,
189+
&prev_features - &cur_features,
190+
prev.1
191+
);
192+
}
189193
}
190194
eprintln!();
191195
eprintln!(

0 commit comments

Comments
 (0)