Skip to content

Commit 0c3200f

Browse files
committed
Don't suggests deprecated congurations
1 parent b80ee52 commit 0c3200f

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

clippy_config/src/conf.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,23 @@ impl serde::de::Error for FieldError {
940940
// set and allows it.
941941
use fmt::Write;
942942

943-
let mut expected = expected.to_vec();
943+
let metadata = get_configuration_metadata();
944+
let deprecated = metadata
945+
.iter()
946+
.filter_map(|conf| {
947+
if conf.deprecation_reason.is_some() {
948+
Some(conf.name.as_str())
949+
} else {
950+
None
951+
}
952+
})
953+
.collect::<Vec<_>>();
954+
955+
let mut expected = expected
956+
.iter()
957+
.copied()
958+
.filter(|name| !deprecated.contains(name))
959+
.collect::<Vec<_>>();
944960
expected.sort_unstable();
945961

946962
let (rows, column_widths) = calculate_dimensions(&expected);

tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr

+3-9
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
2929
array-size-threshold
3030
avoid-breaking-exported-api
3131
await-holding-invalid-types
32-
blacklisted-names
3332
cargo-ignore-publish
3433
check-incompatible-msrv-in-tests
34+
check-inconsistent-struct-field-initializers
3535
check-private-items
3636
cognitive-complexity-threshold
37-
cyclomatic-complexity-threshold
3837
disallowed-macros
3938
disallowed-methods
4039
disallowed-names
@@ -49,7 +48,6 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
4948
future-size-threshold
5049
ignore-interior-mutability
5150
large-error-threshold
52-
lint-inconsistent-struct-field-initializers
5351
literal-representation-threshold
5452
matches-for-let-else
5553
max-fn-params-bools
@@ -121,12 +119,11 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
121119
array-size-threshold
122120
avoid-breaking-exported-api
123121
await-holding-invalid-types
124-
blacklisted-names
125122
cargo-ignore-publish
126123
check-incompatible-msrv-in-tests
124+
check-inconsistent-struct-field-initializers
127125
check-private-items
128126
cognitive-complexity-threshold
129-
cyclomatic-complexity-threshold
130127
disallowed-macros
131128
disallowed-methods
132129
disallowed-names
@@ -141,7 +138,6 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
141138
future-size-threshold
142139
ignore-interior-mutability
143140
large-error-threshold
144-
lint-inconsistent-struct-field-initializers
145141
literal-representation-threshold
146142
matches-for-let-else
147143
max-fn-params-bools
@@ -213,12 +209,11 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
213209
array-size-threshold
214210
avoid-breaking-exported-api
215211
await-holding-invalid-types
216-
blacklisted-names
217212
cargo-ignore-publish
218213
check-incompatible-msrv-in-tests
214+
check-inconsistent-struct-field-initializers
219215
check-private-items
220216
cognitive-complexity-threshold
221-
cyclomatic-complexity-threshold
222217
disallowed-macros
223218
disallowed-methods
224219
disallowed-names
@@ -233,7 +228,6 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
233228
future-size-threshold
234229
ignore-interior-mutability
235230
large-error-threshold
236-
lint-inconsistent-struct-field-initializers
237231
literal-representation-threshold
238232
matches-for-let-else
239233
max-fn-params-bools

0 commit comments

Comments
 (0)