@@ -1201,20 +1201,16 @@ impl<'gctx> Workspace<'gctx> {
1201
1201
pub fn emit_warnings ( & self ) -> CargoResult < ( ) > {
1202
1202
let mut first_emitted_error = None ;
1203
1203
1204
- if self . gctx . cli_unstable ( ) . cargo_lints {
1205
- if let Err ( e) = self . emit_ws_lints ( ) {
1206
- first_emitted_error = Some ( e) ;
1207
- }
1204
+ if let Err ( e) = self . emit_ws_lints ( ) {
1205
+ first_emitted_error = Some ( e) ;
1208
1206
}
1209
1207
1210
1208
for ( path, maybe_pkg) in & self . packages . packages {
1211
1209
if let MaybePackage :: Package ( pkg) = maybe_pkg {
1212
- if self . gctx . cli_unstable ( ) . cargo_lints {
1213
- if let Err ( e) = self . emit_pkg_lints ( pkg, & path)
1214
- && first_emitted_error. is_none ( )
1215
- {
1216
- first_emitted_error = Some ( e) ;
1217
- }
1210
+ if let Err ( e) = self . emit_pkg_lints ( pkg, & path)
1211
+ && first_emitted_error. is_none ( )
1212
+ {
1213
+ first_emitted_error = Some ( e) ;
1218
1214
}
1219
1215
}
1220
1216
let warnings = match maybe_pkg {
@@ -1267,16 +1263,18 @@ impl<'gctx> Workspace<'gctx> {
1267
1263
1268
1264
let ws_document = self . root_maybe ( ) . document ( ) ;
1269
1265
1270
- analyze_cargo_lints_table (
1271
- pkg,
1272
- & path,
1273
- & cargo_lints,
1274
- ws_contents,
1275
- ws_document,
1276
- self . root_manifest ( ) ,
1277
- self . gctx ,
1278
- ) ?;
1279
- check_im_a_teapot ( pkg, & path, & cargo_lints, & mut error_count, self . gctx ) ?;
1266
+ if self . gctx . cli_unstable ( ) . cargo_lints {
1267
+ analyze_cargo_lints_table (
1268
+ pkg,
1269
+ & path,
1270
+ & cargo_lints,
1271
+ ws_contents,
1272
+ ws_document,
1273
+ self . root_manifest ( ) ,
1274
+ self . gctx ,
1275
+ ) ?;
1276
+ check_im_a_teapot ( pkg, & path, & cargo_lints, & mut error_count, self . gctx ) ?;
1277
+ }
1280
1278
1281
1279
if error_count > 0 {
1282
1280
Err ( crate :: util:: errors:: AlreadyPrintedError :: new ( anyhow ! (
@@ -1312,6 +1310,10 @@ impl<'gctx> Workspace<'gctx> {
1312
1310
. cloned ( )
1313
1311
. unwrap_or ( manifest:: TomlToolLints :: default ( ) ) ;
1314
1312
1313
+ if self . gctx . cli_unstable ( ) . cargo_lints {
1314
+ // Calls to lint functions go in here
1315
+ }
1316
+
1315
1317
if error_count > 0 {
1316
1318
Err ( crate :: util:: errors:: AlreadyPrintedError :: new ( anyhow ! (
1317
1319
"encountered {error_count} errors(s) while running lints"
0 commit comments