@@ -1377,70 +1377,26 @@ pub fn to_real_manifest(
13771377 }
13781378
13791379 if is_embedded {
1380- let invalid_fields = [
1380+ let mut invalid_fields = vec ! [
13811381 ( "`workspace`" , original_toml. workspace. is_some( ) ) ,
13821382 ( "`lib`" , original_toml. lib. is_some( ) ) ,
13831383 ( "`bin`" , original_toml. bin. is_some( ) ) ,
13841384 ( "`example`" , original_toml. example. is_some( ) ) ,
13851385 ( "`test`" , original_toml. test. is_some( ) ) ,
13861386 ( "`bench`" , original_toml. bench. is_some( ) ) ,
1387- (
1388- "`package.workspace`" ,
1389- original_toml
1390- . package ( )
1391- . map ( |p| p. workspace . is_some ( ) )
1392- . unwrap_or ( false ) ,
1393- ) ,
1394- (
1395- "`package.build`" ,
1396- original_toml
1397- . package ( )
1398- . map ( |p| p. build . is_some ( ) )
1399- . unwrap_or ( false ) ,
1400- ) ,
1401- (
1402- "`package.links`" ,
1403- original_toml
1404- . package ( )
1405- . map ( |p| p. links . is_some ( ) )
1406- . unwrap_or ( false ) ,
1407- ) ,
1408- (
1409- "`package.autolib`" ,
1410- original_toml
1411- . package ( )
1412- . map ( |p| p. autolib . is_some ( ) )
1413- . unwrap_or ( false ) ,
1414- ) ,
1415- (
1416- "`package.autobins`" ,
1417- original_toml
1418- . package ( )
1419- . map ( |p| p. autobins . is_some ( ) )
1420- . unwrap_or ( false ) ,
1421- ) ,
1422- (
1423- "`package.autoexamples`" ,
1424- original_toml
1425- . package ( )
1426- . map ( |p| p. autoexamples . is_some ( ) )
1427- . unwrap_or ( false ) ,
1428- ) ,
1429- (
1430- "`package.autotests`" ,
1431- original_toml
1432- . package ( )
1433- . map ( |p| p. autotests . is_some ( ) )
1434- . unwrap_or ( false ) ,
1435- ) ,
1436- (
1437- "`package.autobenches`" ,
1438- original_toml
1439- . package ( )
1440- . map ( |p| p. autobenches . is_some ( ) )
1441- . unwrap_or ( false ) ,
1442- ) ,
14431387 ] ;
1388+ if let Some ( package) = original_toml. package ( ) {
1389+ invalid_fields. extend ( [
1390+ ( "`package.workspace`" , package. workspace . is_some ( ) ) ,
1391+ ( "`package.build`" , package. build . is_some ( ) ) ,
1392+ ( "`package.links`" , package. links . is_some ( ) ) ,
1393+ ( "`package.autolib`" , package. autolib . is_some ( ) ) ,
1394+ ( "`package.autobins`" , package. autobins . is_some ( ) ) ,
1395+ ( "`package.autoexamples`" , package. autoexamples . is_some ( ) ) ,
1396+ ( "`package.autotests`" , package. autotests . is_some ( ) ) ,
1397+ ( "`package.autobenches`" , package. autobenches . is_some ( ) ) ,
1398+ ] ) ;
1399+ }
14441400 let invalid_fields = invalid_fields
14451401 . into_iter ( )
14461402 . filter_map ( |( name, invalid) | invalid. then_some ( name) )
0 commit comments