@@ -40,7 +40,6 @@ pub(super) fn to_targets(
40
40
edition : Edition ,
41
41
metabuild : & Option < StringOrVec > ,
42
42
warnings : & mut Vec < String > ,
43
- errors : & mut Vec < String > ,
44
43
) -> CargoResult < Vec < Target > > {
45
44
let mut targets = Vec :: new ( ) ;
46
45
@@ -64,8 +63,6 @@ pub(super) fn to_targets(
64
63
resolved_toml. bin . as_deref ( ) . unwrap_or_default ( ) ,
65
64
package_root,
66
65
edition,
67
- warnings,
68
- errors,
69
66
) ?) ;
70
67
71
68
targets. extend ( to_example_targets (
@@ -261,6 +258,7 @@ pub fn resolve_bins(
261
258
edition : Edition ,
262
259
autodiscover : Option < bool > ,
263
260
warnings : & mut Vec < String > ,
261
+ errors : & mut Vec < String > ,
264
262
has_lib : bool ,
265
263
) -> CargoResult < Vec < TomlBinTarget > > {
266
264
let inferred = inferred_bins ( package_root, package_name) ;
@@ -279,6 +277,8 @@ pub fn resolve_bins(
279
277
280
278
for bin in & mut bins {
281
279
validate_bin_name ( bin, warnings) ?;
280
+ validate_bin_crate_types ( bin, warnings, errors) ?;
281
+ validate_bin_proc_macro ( bin, warnings, errors) ?;
282
282
283
283
let path = target_path ( bin, & inferred, "bin" , package_root, edition, & mut |_| {
284
284
if let Some ( legacy_path) = legacy_bin_path ( package_root, name_or_panic ( bin) , has_lib) {
@@ -309,8 +309,6 @@ fn to_bin_targets(
309
309
bins : & [ TomlBinTarget ] ,
310
310
package_root : & Path ,
311
311
edition : Edition ,
312
- warnings : & mut Vec < String > ,
313
- errors : & mut Vec < String > ,
314
312
) -> CargoResult < Vec < Target > > {
315
313
// This loop performs basic checks on each of the TomlTarget in `bins`.
316
314
for bin in bins {
@@ -319,9 +317,6 @@ fn to_bin_targets(
319
317
if bin. filename . is_some ( ) {
320
318
features. require ( Feature :: different_binary_name ( ) ) ?;
321
319
}
322
-
323
- validate_bin_crate_types ( bin, warnings, errors) ?;
324
- validate_bin_proc_macro ( bin, warnings, errors) ?;
325
320
}
326
321
327
322
validate_unique_names ( & bins, "binary" ) ?;
0 commit comments