@@ -479,21 +479,6 @@ pub fn to_real_manifest(
479
479
) ;
480
480
} ;
481
481
482
- if let Some ( deps) = original_toml
483
- . workspace
484
- . as_ref ( )
485
- . and_then ( |ws| ws. dependencies . as_ref ( ) )
486
- {
487
- for ( name, dep) in deps {
488
- if dep. is_optional ( ) {
489
- bail ! ( "{name} is optional, but workspace dependencies cannot be optional" , ) ;
490
- }
491
- if dep. is_public ( ) {
492
- bail ! ( "{name} is public, but workspace dependencies cannot be public" , ) ;
493
- }
494
- }
495
- }
496
-
497
482
// Parse features first so they will be available when parsing other parts of the TOML.
498
483
let empty = Vec :: new ( ) ;
499
484
let cargo_features = original_toml. cargo_features . as_ref ( ) . unwrap_or ( & empty) ;
@@ -1225,6 +1210,15 @@ fn to_workspace_config(
1225
1210
( Some ( toml_config) , None ) => {
1226
1211
verify_lints ( toml_config. lints . as_ref ( ) , gctx, warnings) ?;
1227
1212
if let Some ( ws_deps) = & toml_config. dependencies {
1213
+ for ( name, dep) in ws_deps {
1214
+ if dep. is_optional ( ) {
1215
+ bail ! ( "{name} is optional, but workspace dependencies cannot be optional" , ) ;
1216
+ }
1217
+ if dep. is_public ( ) {
1218
+ bail ! ( "{name} is public, but workspace dependencies cannot be public" , ) ;
1219
+ }
1220
+ }
1221
+
1228
1222
for ( name, dep) in ws_deps {
1229
1223
unused_dep_keys ( name, "workspace.dependencies" , dep. unused_keys ( ) , warnings) ;
1230
1224
}
@@ -1278,21 +1272,6 @@ fn to_virtual_manifest(
1278
1272
1279
1273
let mut resolved_toml = original_toml. clone ( ) ;
1280
1274
1281
- if let Some ( deps) = original_toml
1282
- . workspace
1283
- . as_ref ( )
1284
- . and_then ( |ws| ws. dependencies . as_ref ( ) )
1285
- {
1286
- for ( name, dep) in deps {
1287
- if dep. is_optional ( ) {
1288
- bail ! ( "{name} is optional, but workspace dependencies cannot be optional" , ) ;
1289
- }
1290
- if dep. is_public ( ) {
1291
- bail ! ( "{name} is public, but workspace dependencies cannot be public" , ) ;
1292
- }
1293
- }
1294
- }
1295
-
1296
1275
for field in original_toml. requires_package ( ) {
1297
1276
bail ! ( "this virtual manifest specifies a `{field}` section, which is not allowed" ) ;
1298
1277
}
0 commit comments