File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -321,15 +321,7 @@ fn to_bin_targets(
321321 }
322322
323323 validate_bin_crate_types ( bin, warnings, errors) ?;
324-
325- if bin. proc_macro ( ) == Some ( true ) {
326- let name = name_or_panic ( bin) ;
327- errors. push ( format ! (
328- "the target `{}` is a binary and can't have `proc-macro` \
329- set `true`",
330- name
331- ) ) ;
332- }
324+ validate_bin_proc_macro ( bin, warnings, errors) ?;
333325 }
334326
335327 validate_unique_names ( & bins, "binary" ) ?;
@@ -1068,6 +1060,22 @@ fn name_or_panic(target: &TomlTarget) -> &str {
10681060 . unwrap_or_else ( || panic ! ( "target name is required" ) )
10691061}
10701062
1063+ fn validate_bin_proc_macro (
1064+ target : & TomlTarget ,
1065+ _warnings : & mut Vec < String > ,
1066+ errors : & mut Vec < String > ,
1067+ ) -> CargoResult < ( ) > {
1068+ if target. proc_macro ( ) == Some ( true ) {
1069+ let name = name_or_panic ( target) ;
1070+ errors. push ( format ! (
1071+ "the target `{}` is a binary and can't have `proc-macro` \
1072+ set `true`",
1073+ name
1074+ ) ) ;
1075+ }
1076+ Ok ( ( ) )
1077+ }
1078+
10711079fn validate_proc_macro (
10721080 target : & TomlTarget ,
10731081 kind : & str ,
You can’t perform that action at this time.
0 commit comments