@@ -1149,25 +1149,11 @@ impl<'gctx> Workspace<'gctx> {
1149
1149
}
1150
1150
1151
1151
pub fn emit_warnings ( & self ) -> CargoResult < ( ) > {
1152
- let ws_lints = self
1153
- . root_maybe ( )
1154
- . workspace_config ( )
1155
- . inheritable ( )
1156
- . and_then ( |i| i. lints ( ) . ok ( ) )
1157
- . unwrap_or_default ( ) ;
1158
-
1159
- let ws_cargo_lints = ws_lints
1160
- . get ( "cargo" )
1161
- . cloned ( )
1162
- . unwrap_or_default ( )
1163
- . into_iter ( )
1164
- . collect ( ) ;
1165
-
1166
1152
for ( path, maybe_pkg) in & self . packages . packages {
1167
1153
let path = path. join ( "Cargo.toml" ) ;
1168
1154
if let MaybePackage :: Package ( pkg) = maybe_pkg {
1169
1155
if self . gctx . cli_unstable ( ) . cargo_lints {
1170
- self . emit_lints ( pkg, & path, & ws_cargo_lints ) ?
1156
+ self . emit_lints ( pkg, & path) ?
1171
1157
}
1172
1158
}
1173
1159
let warnings = match maybe_pkg {
@@ -1195,12 +1181,7 @@ impl<'gctx> Workspace<'gctx> {
1195
1181
Ok ( ( ) )
1196
1182
}
1197
1183
1198
- pub fn emit_lints (
1199
- & self ,
1200
- pkg : & Package ,
1201
- path : & Path ,
1202
- ws_cargo_lints : & manifest:: TomlToolLints ,
1203
- ) -> CargoResult < ( ) > {
1184
+ pub fn emit_lints ( & self , pkg : & Package , path : & Path ) -> CargoResult < ( ) > {
1204
1185
let mut error_count = 0 ;
1205
1186
let toml_lints = pkg
1206
1187
. manifest ( )
@@ -1214,16 +1195,6 @@ impl<'gctx> Workspace<'gctx> {
1214
1195
. cloned ( )
1215
1196
. unwrap_or ( manifest:: TomlToolLints :: default ( ) ) ;
1216
1197
1217
- // We should only be using workspace lints if the `[lints]` table is
1218
- // present in the manifest, and `workspace` is set to `true`
1219
- let ws_cargo_lints = pkg
1220
- . manifest ( )
1221
- . resolved_toml ( )
1222
- . lints
1223
- . as_ref ( )
1224
- . is_some_and ( |l| l. workspace )
1225
- . then ( || ws_cargo_lints) ;
1226
-
1227
1198
let ws_contents = match self . root_maybe ( ) {
1228
1199
MaybePackage :: Package ( pkg) => pkg. manifest ( ) . contents ( ) ,
1229
1200
MaybePackage :: Virtual ( v) => v. contents ( ) ,
@@ -1238,36 +1209,14 @@ impl<'gctx> Workspace<'gctx> {
1238
1209
pkg,
1239
1210
& path,
1240
1211
& cargo_lints,
1241
- ws_cargo_lints,
1242
1212
ws_contents,
1243
1213
ws_document,
1244
1214
self . root_manifest ( ) ,
1245
1215
self . gctx ,
1246
1216
) ?;
1247
- check_im_a_teapot (
1248
- pkg,
1249
- & path,
1250
- & cargo_lints,
1251
- ws_cargo_lints,
1252
- & mut error_count,
1253
- self . gctx ,
1254
- ) ?;
1255
- check_implicit_features (
1256
- pkg,
1257
- & path,
1258
- & cargo_lints,
1259
- ws_cargo_lints,
1260
- & mut error_count,
1261
- self . gctx ,
1262
- ) ?;
1263
- unused_dependencies (
1264
- pkg,
1265
- & path,
1266
- & cargo_lints,
1267
- ws_cargo_lints,
1268
- & mut error_count,
1269
- self . gctx ,
1270
- ) ?;
1217
+ check_im_a_teapot ( pkg, & path, & cargo_lints, & mut error_count, self . gctx ) ?;
1218
+ check_implicit_features ( pkg, & path, & cargo_lints, & mut error_count, self . gctx ) ?;
1219
+ unused_dependencies ( pkg, & path, & cargo_lints, & mut error_count, self . gctx ) ?;
1271
1220
if error_count > 0 {
1272
1221
Err ( crate :: util:: errors:: AlreadyPrintedError :: new ( anyhow ! (
1273
1222
"encountered {error_count} errors(s) while running lints"
0 commit comments