@@ -1205,10 +1205,15 @@ impl<'gctx> Workspace<'gctx> {
1205
1205
}
1206
1206
1207
1207
pub fn emit_warnings ( & self ) -> CargoResult < ( ) > {
1208
+ let mut first_emitted_error = None ;
1208
1209
for ( path, maybe_pkg) in & self . packages . packages {
1209
1210
if let MaybePackage :: Package ( pkg) = maybe_pkg {
1210
1211
if self . gctx . cli_unstable ( ) . cargo_lints {
1211
- self . emit_lints ( pkg, & path) ?
1212
+ if let Err ( e) = self . emit_lints ( pkg, & path)
1213
+ && first_emitted_error. is_none ( )
1214
+ {
1215
+ first_emitted_error = Some ( e) ;
1216
+ }
1212
1217
}
1213
1218
}
1214
1219
let warnings = match maybe_pkg {
@@ -1220,7 +1225,9 @@ impl<'gctx> Workspace<'gctx> {
1220
1225
let err = anyhow:: format_err!( "{}" , warning. message) ;
1221
1226
let cx =
1222
1227
anyhow:: format_err!( "failed to parse manifest at `{}`" , path. display( ) ) ;
1223
- return Err ( err. context ( cx) ) ;
1228
+ if first_emitted_error. is_none ( ) {
1229
+ first_emitted_error = Some ( err. context ( cx) ) ;
1230
+ }
1224
1231
} else {
1225
1232
let msg = if self . root_manifest . is_none ( ) {
1226
1233
warning. message . to_string ( )
@@ -1233,7 +1240,12 @@ impl<'gctx> Workspace<'gctx> {
1233
1240
}
1234
1241
}
1235
1242
}
1236
- Ok ( ( ) )
1243
+
1244
+ if let Some ( error) = first_emitted_error {
1245
+ Err ( error)
1246
+ } else {
1247
+ Ok ( ( ) )
1248
+ }
1237
1249
}
1238
1250
1239
1251
pub fn emit_lints ( & self , pkg : & Package , path : & Path ) -> CargoResult < ( ) > {
0 commit comments