diff --git a/Cargo.toml b/Cargo.toml index bcd800930c51..165876691914 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ pulldown-cmark = { version = "0.11", default-features = false, features = ["html askama = { version = "0.15.4", default-features = false, features = ["alloc", "config", "derive"] } [dev-dependencies.toml] -version = "0.9.7" +version = "1.1" default-features = false # preserve_order keeps diagnostic output in file order features = ["parse", "preserve_order"] diff --git a/clippy_config/Cargo.toml b/clippy_config/Cargo.toml index 366c776b8f1a..5dbc0d37d4e9 100644 --- a/clippy_config/Cargo.toml +++ b/clippy_config/Cargo.toml @@ -10,7 +10,7 @@ publish = false clippy_utils = { path = "../clippy_utils" } itertools = "0.12" serde = { version = "1.0", features = ["derive"] } -toml = "0.7.3" +toml = "1.1" [dev-dependencies] walkdir = "2.3" diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs index 41099f94b044..c3797189f797 100644 --- a/clippy_config/src/conf.rs +++ b/clippy_config/src/conf.rs @@ -974,7 +974,9 @@ pub fn lookup_conf_file() -> io::Result<(Option, Vec)> { } fn deserialize(file: &SourceFile) -> TryConf { - match toml::de::Deserializer::new(file.src.as_ref().unwrap()).deserialize_map(ConfVisitor(file)) { + match toml::de::Deserializer::parse(file.src.as_ref().unwrap()) + .and_then(|deserializer| deserializer.deserialize_map(ConfVisitor(file))) + { Ok(mut conf) => { extend_vec_if_indicator_present(&mut conf.conf.disallowed_names, DEFAULT_DISALLOWED_NAMES); extend_vec_if_indicator_present(&mut conf.conf.allowed_prefixes, DEFAULT_ALLOWED_PREFIXES); diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index 51e753efb52e..04544594ae00 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -24,7 +24,7 @@ semver = "1.0" url = "2.2" [dependencies.toml] -version = "0.9.7" +version = "1.1" default-features = false # preserve_order keeps diagnostic output in file order features = ["parse", "preserve_order"] diff --git a/lintcheck/Cargo.toml b/lintcheck/Cargo.toml index 34281f9f721b..e1abf51b59fc 100644 --- a/lintcheck/Cargo.toml +++ b/lintcheck/Cargo.toml @@ -22,6 +22,6 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.85" strip-ansi-escapes = "0.2.0" tar = "0.4.45" -toml = "0.9.7" +toml = "1.1" ureq = { version = "2.2", features = ["json"] } walkdir = "2.3" diff --git a/tests/ui-toml/bad_toml/conf_bad_toml.rs b/tests/ui-toml/bad_toml/conf_bad_toml.rs index c69fcd300335..3b34ddf89418 100644 --- a/tests/ui-toml/bad_toml/conf_bad_toml.rs +++ b/tests/ui-toml/bad_toml/conf_bad_toml.rs @@ -1,3 +1,3 @@ -//@error-in-other-file: error reading Clippy's configuration file: expected `.`, `=` +//@error-in-other-file: error reading Clippy's configuration file: key with no value, expected `=` fn main() {} diff --git a/tests/ui-toml/bad_toml/conf_bad_toml.stderr b/tests/ui-toml/bad_toml/conf_bad_toml.stderr index eaf174b04b49..1dea94a58b60 100644 --- a/tests/ui-toml/bad_toml/conf_bad_toml.stderr +++ b/tests/ui-toml/bad_toml/conf_bad_toml.stderr @@ -1,4 +1,4 @@ -error: error reading Clippy's configuration file: expected `.`, `=` +error: error reading Clippy's configuration file: key with no value, expected `=` --> $DIR/tests/ui-toml/bad_toml/clippy.toml:1:4 | LL | fn this_is_obviously(not: a, toml: file) { diff --git a/tests/ui-toml/duplicated_keys/duplicated_keys.rs b/tests/ui-toml/duplicated_keys/duplicated_keys.rs index 187775545ed7..1a275e689276 100644 --- a/tests/ui-toml/duplicated_keys/duplicated_keys.rs +++ b/tests/ui-toml/duplicated_keys/duplicated_keys.rs @@ -1,3 +1,3 @@ -//@error-in-other-file: duplicate key `cognitive-complexity-threshold` +//@error-in-other-file: duplicate key fn main() {} diff --git a/tests/ui-toml/duplicated_keys/duplicated_keys.stderr b/tests/ui-toml/duplicated_keys/duplicated_keys.stderr index 9f11c94ded2b..b36ffdf865bc 100644 --- a/tests/ui-toml/duplicated_keys/duplicated_keys.stderr +++ b/tests/ui-toml/duplicated_keys/duplicated_keys.stderr @@ -1,8 +1,8 @@ -error: error reading Clippy's configuration file: duplicate key `cognitive-complexity-threshold` in document root +error: error reading Clippy's configuration file: duplicate key --> $DIR/tests/ui-toml/duplicated_keys/clippy.toml:2:1 | LL | cognitive-complexity-threshold = 4 - | ^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui-toml/toml_invalid_path/conf_invalid_path.stderr b/tests/ui-toml/toml_invalid_path/conf_invalid_path.stderr index 59a427dc99ca..96f419a9de1f 100644 --- a/tests/ui-toml/toml_invalid_path/conf_invalid_path.stderr +++ b/tests/ui-toml/toml_invalid_path/conf_invalid_path.stderr @@ -1,36 +1,32 @@ warning: expected a macro, found a primitive type --> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:1:1 | -LL | / [[disallowed-macros]] -LL | | path = "bool" - | |_____________^ +LL | [[disallowed-macros]] + | ^^^^^^^^^^^^^^^^^^^^^ | = help: add `allow-invalid = true` to the entry to suppress this warning warning: `std::process::current_exe` does not refer to a reachable function --> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:4:1 | -LL | / [[disallowed-methods]] -LL | | path = "std::process::current_exe" - | |__________________________________^ +LL | [[disallowed-methods]] + | ^^^^^^^^^^^^^^^^^^^^^^ | = help: add `allow-invalid = true` to the entry to suppress this warning warning: `` does not refer to a reachable function --> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:7:1 | -LL | / [[disallowed-methods]] -LL | | path = "" - | |_________^ +LL | [[disallowed-methods]] + | ^^^^^^^^^^^^^^^^^^^^^^ | = help: add `allow-invalid = true` to the entry to suppress this warning warning: expected a type, found a variant --> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:10:1 | -LL | / [[disallowed-types]] -LL | | path = "std::result::Result::Err" - | |_________________________________^ +LL | [[disallowed-types]] + | ^^^^^^^^^^^^^^^^^^^^ | = help: add `allow-invalid = true` to the entry to suppress this warning diff --git a/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr b/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr index e5fd548b26df..3c23a195897a 100644 --- a/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr +++ b/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr @@ -1,18 +1,16 @@ warning: `regex::Regex::new_` does not refer to a reachable function --> $DIR/tests/ui-toml/toml_unloaded_crate/clippy.toml:3:1 | -LL | / [[disallowed-methods]] -LL | | path = "regex::Regex::new_" - | |___________________________^ +LL | [[disallowed-methods]] + | ^^^^^^^^^^^^^^^^^^^^^^ | = help: add `allow-invalid = true` to the entry to suppress this warning warning: `regex::Regex_::new` does not refer to a reachable function --> $DIR/tests/ui-toml/toml_unloaded_crate/clippy.toml:6:1 | -LL | / [[disallowed-methods]] -LL | | path = "regex::Regex_::new" - | |___________________________^ +LL | [[disallowed-methods]] + | ^^^^^^^^^^^^^^^^^^^^^^ | = help: add `allow-invalid = true` to the entry to suppress this warning