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(
321
321
}
322
322
323
323
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) ?;
333
325
}
334
326
335
327
validate_unique_names ( & bins, "binary" ) ?;
@@ -1068,6 +1060,22 @@ fn name_or_panic(target: &TomlTarget) -> &str {
1068
1060
. unwrap_or_else ( || panic ! ( "target name is required" ) )
1069
1061
}
1070
1062
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
+
1071
1079
fn validate_proc_macro (
1072
1080
target : & TomlTarget ,
1073
1081
kind : & str ,
You can’t perform that action at this time.
0 commit comments