@@ -231,6 +231,8 @@ pub enum ProcMacroExpansionError {
231231 System ( String ) ,
232232}
233233
234+ pub type ProcMacroLoadResult = Result < Vec < ProcMacro > , String > ;
235+
234236#[ derive( Debug , Clone ) ]
235237pub struct ProcMacro {
236238 pub name : SmolStr ,
@@ -254,7 +256,7 @@ pub struct CrateData {
254256 pub potential_cfg_options : CfgOptions ,
255257 pub env : Env ,
256258 pub dependencies : Vec < Dependency > ,
257- pub proc_macro : Vec < ProcMacro > ,
259+ pub proc_macro : ProcMacroLoadResult ,
258260 pub origin : CrateOrigin ,
259261 pub is_proc_macro : bool ,
260262}
@@ -300,19 +302,19 @@ impl Dependency {
300302impl CrateGraph {
301303 pub fn add_crate_root (
302304 & mut self ,
303- file_id : FileId ,
305+ root_file_id : FileId ,
304306 edition : Edition ,
305307 display_name : Option < CrateDisplayName > ,
306308 version : Option < String > ,
307309 cfg_options : CfgOptions ,
308310 potential_cfg_options : CfgOptions ,
309311 env : Env ,
310- proc_macro : Vec < ProcMacro > ,
312+ proc_macro : ProcMacroLoadResult ,
311313 is_proc_macro : bool ,
312314 origin : CrateOrigin ,
313315 ) -> CrateId {
314316 let data = CrateData {
315- root_file_id : file_id ,
317+ root_file_id,
316318 edition,
317319 version,
318320 display_name,
@@ -628,7 +630,7 @@ mod tests {
628630 CfgOptions :: default ( ) ,
629631 CfgOptions :: default ( ) ,
630632 Env :: default ( ) ,
631- Default :: default ( ) ,
633+ Ok ( Vec :: new ( ) ) ,
632634 false ,
633635 CrateOrigin :: CratesIo { repo : None } ,
634636 ) ;
@@ -640,7 +642,7 @@ mod tests {
640642 CfgOptions :: default ( ) ,
641643 CfgOptions :: default ( ) ,
642644 Env :: default ( ) ,
643- Default :: default ( ) ,
645+ Ok ( Vec :: new ( ) ) ,
644646 false ,
645647 CrateOrigin :: CratesIo { repo : None } ,
646648 ) ;
@@ -652,7 +654,7 @@ mod tests {
652654 CfgOptions :: default ( ) ,
653655 CfgOptions :: default ( ) ,
654656 Env :: default ( ) ,
655- Default :: default ( ) ,
657+ Ok ( Vec :: new ( ) ) ,
656658 false ,
657659 CrateOrigin :: CratesIo { repo : None } ,
658660 ) ;
@@ -678,7 +680,7 @@ mod tests {
678680 CfgOptions :: default ( ) ,
679681 CfgOptions :: default ( ) ,
680682 Env :: default ( ) ,
681- Default :: default ( ) ,
683+ Ok ( Vec :: new ( ) ) ,
682684 false ,
683685 CrateOrigin :: CratesIo { repo : None } ,
684686 ) ;
@@ -690,7 +692,7 @@ mod tests {
690692 CfgOptions :: default ( ) ,
691693 CfgOptions :: default ( ) ,
692694 Env :: default ( ) ,
693- Default :: default ( ) ,
695+ Ok ( Vec :: new ( ) ) ,
694696 false ,
695697 CrateOrigin :: CratesIo { repo : None } ,
696698 ) ;
@@ -713,7 +715,7 @@ mod tests {
713715 CfgOptions :: default ( ) ,
714716 CfgOptions :: default ( ) ,
715717 Env :: default ( ) ,
716- Default :: default ( ) ,
718+ Ok ( Vec :: new ( ) ) ,
717719 false ,
718720 CrateOrigin :: CratesIo { repo : None } ,
719721 ) ;
@@ -725,7 +727,7 @@ mod tests {
725727 CfgOptions :: default ( ) ,
726728 CfgOptions :: default ( ) ,
727729 Env :: default ( ) ,
728- Default :: default ( ) ,
730+ Ok ( Vec :: new ( ) ) ,
729731 false ,
730732 CrateOrigin :: CratesIo { repo : None } ,
731733 ) ;
@@ -737,7 +739,7 @@ mod tests {
737739 CfgOptions :: default ( ) ,
738740 CfgOptions :: default ( ) ,
739741 Env :: default ( ) ,
740- Default :: default ( ) ,
742+ Ok ( Vec :: new ( ) ) ,
741743 false ,
742744 CrateOrigin :: CratesIo { repo : None } ,
743745 ) ;
@@ -760,7 +762,7 @@ mod tests {
760762 CfgOptions :: default ( ) ,
761763 CfgOptions :: default ( ) ,
762764 Env :: default ( ) ,
763- Default :: default ( ) ,
765+ Ok ( Vec :: new ( ) ) ,
764766 false ,
765767 CrateOrigin :: CratesIo { repo : None } ,
766768 ) ;
@@ -772,7 +774,7 @@ mod tests {
772774 CfgOptions :: default ( ) ,
773775 CfgOptions :: default ( ) ,
774776 Env :: default ( ) ,
775- Default :: default ( ) ,
777+ Ok ( Vec :: new ( ) ) ,
776778 false ,
777779 CrateOrigin :: CratesIo { repo : None } ,
778780 ) ;
0 commit comments