@@ -40,7 +40,6 @@ pub(super) fn to_targets(
4040 edition : Edition ,
4141 metabuild : & Option < StringOrVec > ,
4242 warnings : & mut Vec < String > ,
43- errors : & mut Vec < String > ,
4443) -> CargoResult < Vec < Target > > {
4544 let mut targets = Vec :: new ( ) ;
4645
@@ -64,8 +63,6 @@ pub(super) fn to_targets(
6463 resolved_toml. bin . as_deref ( ) . unwrap_or_default ( ) ,
6564 package_root,
6665 edition,
67- warnings,
68- errors,
6966 ) ?) ;
7067
7168 targets. extend ( to_example_targets (
@@ -261,6 +258,7 @@ pub fn resolve_bins(
261258 edition : Edition ,
262259 autodiscover : Option < bool > ,
263260 warnings : & mut Vec < String > ,
261+ errors : & mut Vec < String > ,
264262 has_lib : bool ,
265263) -> CargoResult < Vec < TomlBinTarget > > {
266264 let inferred = inferred_bins ( package_root, package_name) ;
@@ -279,6 +277,8 @@ pub fn resolve_bins(
279277
280278 for bin in & mut bins {
281279 validate_bin_name ( bin, warnings) ?;
280+ validate_bin_crate_types ( bin, warnings, errors) ?;
281+ validate_bin_proc_macro ( bin, warnings, errors) ?;
282282
283283 let path = target_path ( bin, & inferred, "bin" , package_root, edition, & mut |_| {
284284 if let Some ( legacy_path) = legacy_bin_path ( package_root, name_or_panic ( bin) , has_lib) {
@@ -309,8 +309,6 @@ fn to_bin_targets(
309309 bins : & [ TomlBinTarget ] ,
310310 package_root : & Path ,
311311 edition : Edition ,
312- warnings : & mut Vec < String > ,
313- errors : & mut Vec < String > ,
314312) -> CargoResult < Vec < Target > > {
315313 // This loop performs basic checks on each of the TomlTarget in `bins`.
316314 for bin in bins {
@@ -319,9 +317,6 @@ fn to_bin_targets(
319317 if bin. filename . is_some ( ) {
320318 features. require ( Feature :: different_binary_name ( ) ) ?;
321319 }
322-
323- validate_bin_crate_types ( bin, warnings, errors) ?;
324- validate_bin_proc_macro ( bin, warnings, errors) ?;
325320 }
326321
327322 validate_unique_names ( & bins, "binary" ) ?;
0 commit comments