@@ -1062,7 +1062,7 @@ fn cargo_to_crate_graph(
1062
1062
proc_macros,
1063
1063
cargo,
1064
1064
pkg_data,
1065
- build_data,
1065
+ build_data. zip ( Some ( build_scripts . error ( ) . is_some ( ) ) ) ,
1066
1066
cfg_options. clone ( ) ,
1067
1067
file_id,
1068
1068
name,
@@ -1285,7 +1285,7 @@ fn handle_rustc_crates(
1285
1285
proc_macros,
1286
1286
rustc_workspace,
1287
1287
& rustc_workspace[ pkg] ,
1288
- build_scripts. get_output ( pkg) ,
1288
+ build_scripts. get_output ( pkg) . zip ( Some ( build_scripts . error ( ) . is_some ( ) ) ) ,
1289
1289
cfg_options. clone ( ) ,
1290
1290
file_id,
1291
1291
& rustc_workspace[ tgt] . name ,
@@ -1345,7 +1345,7 @@ fn add_target_crate_root(
1345
1345
proc_macros : & mut ProcMacroPaths ,
1346
1346
cargo : & CargoWorkspace ,
1347
1347
pkg : & PackageData ,
1348
- build_data : Option < & BuildScriptOutput > ,
1348
+ build_data : Option < ( & BuildScriptOutput , bool ) > ,
1349
1349
cfg_options : CfgOptions ,
1350
1350
file_id : FileId ,
1351
1351
cargo_name : & str ,
@@ -1368,7 +1368,7 @@ fn add_target_crate_root(
1368
1368
for feature in pkg. active_features . iter ( ) {
1369
1369
opts. insert_key_value ( sym:: feature. clone ( ) , Symbol :: intern ( feature) ) ;
1370
1370
}
1371
- if let Some ( cfgs) = build_data. as_ref ( ) . map ( |it | & it. cfgs ) {
1371
+ if let Some ( cfgs) = build_data. map ( |( it , _ ) | & it. cfgs ) {
1372
1372
opts. extend ( cfgs. iter ( ) . cloned ( ) ) ;
1373
1373
}
1374
1374
opts
@@ -1379,7 +1379,7 @@ fn add_target_crate_root(
1379
1379
inject_cargo_env ( & mut env) ;
1380
1380
inject_rustc_tool_env ( & mut env, cargo, cargo_name, kind) ;
1381
1381
1382
- if let Some ( envs) = build_data. map ( |it | & it. envs ) {
1382
+ if let Some ( envs) = build_data. map ( |( it , _ ) | & it. envs ) {
1383
1383
for ( k, v) in envs {
1384
1384
env. set ( k, v. clone ( ) ) ;
1385
1385
}
@@ -1396,11 +1396,14 @@ fn add_target_crate_root(
1396
1396
origin,
1397
1397
) ;
1398
1398
if let TargetKind :: Lib { is_proc_macro : true } = kind {
1399
- let proc_macro = match build_data. as_ref ( ) . map ( |it| it. proc_macro_dylib_path . as_ref ( ) ) {
1400
- Some ( it) => match it {
1401
- Some ( path) => Ok ( ( cargo_name. to_owned ( ) , path. clone ( ) ) ) ,
1402
- None => Err ( "proc-macro crate build data is missing dylib path" . to_owned ( ) ) ,
1403
- } ,
1399
+ let proc_macro = match build_data {
1400
+ Some ( ( BuildScriptOutput { proc_macro_dylib_path, .. } , has_errors) ) => {
1401
+ match proc_macro_dylib_path {
1402
+ Some ( path) => Ok ( ( cargo_name. to_owned ( ) , path. clone ( ) ) ) ,
1403
+ None if has_errors => Err ( "failed to build proc-macro" . to_owned ( ) ) ,
1404
+ None => Err ( "proc-macro crate build data is missing dylib path" . to_owned ( ) ) ,
1405
+ }
1406
+ }
1404
1407
None => Err ( "proc-macro crate is missing its build data" . to_owned ( ) ) ,
1405
1408
} ;
1406
1409
proc_macros. insert ( crate_id, proc_macro) ;
0 commit comments