@@ -144,7 +144,7 @@ fn run_cargo(
144
144
let mut did_trybuild = false ;
145
145
let mut ran_out_of_space = false ;
146
146
let mut error_codes = BTreeSet :: new ( ) ;
147
- let mut deps = BTreeSet :: new ( ) ;
147
+ let mut deps: Option < BTreeSet < Crate > > = None ;
148
148
149
149
let mut detect_error = |line : & str , actions : & mut ProcessLinesActions | {
150
150
if line. contains ( "urlopen error" ) && line. contains ( "Temporary failure in name resolution" ) {
@@ -189,11 +189,13 @@ fn run_cargo(
189
189
// If the error is in a crate that is not local then it's referred to a dependency
190
190
// of the current crate
191
191
( DiagnosticLevel :: Error , pkgid) => {
192
+ let deps = deps. get_or_insert_default ( ) ;
192
193
if let Ok ( krate) = Crate :: try_from ( pkgid) {
193
194
deps. insert ( krate) ;
194
195
}
195
196
}
196
197
( DiagnosticLevel :: Ice , pkgid) => {
198
+ let deps = deps. get_or_insert_default ( ) ;
197
199
if let Ok ( krate) = Crate :: try_from ( pkgid) {
198
200
deps. insert ( krate) ;
199
201
}
@@ -233,7 +235,7 @@ fn run_cargo(
233
235
Err ( e. context ( FailureReason :: ICE ) . into ( ) )
234
236
} else if ran_out_of_space {
235
237
Err ( e. context ( FailureReason :: NoSpace ) . into ( ) )
236
- } else if !deps . is_empty ( ) {
238
+ } else if let Some ( deps ) = deps {
237
239
Err ( e. context ( FailureReason :: DependsOn ( deps) ) . into ( ) )
238
240
} else if !error_codes. is_empty ( ) {
239
241
Err ( e. context ( FailureReason :: CompilerError ( error_codes) ) . into ( ) )
0 commit comments