@@ -145,6 +145,7 @@ pub(crate) fn fetch_deps(
145145fn run_command ( cmd : Command ) -> anyhow:: Result < ( ) > {
146146 let mut yanked_deps = false ;
147147 let mut missing_deps = false ;
148+ let mut broken_deps = false ;
148149
149150 let mut process = |line : & str , _: & mut ProcessLinesActions | {
150151 if line. contains ( "failed to select a version for the requirement" ) {
@@ -153,6 +154,8 @@ fn run_command(cmd: Command) -> anyhow::Result<()> {
153154 || line. contains ( "no matching package named" )
154155 {
155156 missing_deps = true ;
157+ } else if line. contains ( "failed to parse manifest at" ) {
158+ broken_deps = true ;
156159 }
157160 } ;
158161
@@ -164,6 +167,9 @@ fn run_command(cmd: Command) -> anyhow::Result<()> {
164167 Err ( CommandError :: ExecutionFailed { status : _, stderr } ) if missing_deps => {
165168 Err ( PrepareError :: MissingDependencies ( stderr) . into ( ) )
166169 }
170+ Err ( CommandError :: ExecutionFailed { status : _, stderr } ) if broken_deps => {
171+ Err ( PrepareError :: BrokenDependencies ( stderr) . into ( ) )
172+ }
167173 Err ( err) => Err ( err. into ( ) ) ,
168174 }
169175}
@@ -373,6 +379,9 @@ pub enum PrepareError {
373379 /// rejecting it.
374380 #[ error( "invalid Cargo.toml syntax" ) ]
375381 InvalidCargoTomlSyntax ,
382+ /// Something about the crates dependencies is invalid
383+ #[ error( "broken dependencies: \n \n {0}" ) ]
384+ BrokenDependencies ( String ) ,
376385 /// Some of this crate's dependencies were yanked, preventing Crater from fetching them.
377386 #[ error( "the crate depends on yanked dependencies: \n \n {0}" ) ]
378387 YankedDependencies ( String ) ,
0 commit comments