about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui-toml
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-02-11 15:04:38 +0100
committerflip1995 <philipp.krones@embecosm.com>2021-02-11 15:04:38 +0100
commitd2e2f64ef7bd98c8ce2c9ce77db27ea1617892ea (patch)
treea2147c3fa0e7a643165c22eb8a53a680d8da736a /src/tools/clippy/tests/ui-toml
parent2918062d1d94b65dfd53d265e957d86fcb8bfdbd (diff)
parent70c0f90453701e7d6d9b99aaa1fc6a765937b736 (diff)
downloadrust-d2e2f64ef7bd98c8ce2c9ce77db27ea1617892ea.tar.gz
rust-d2e2f64ef7bd98c8ce2c9ce77db27ea1617892ea.zip
Merge commit '70c0f90453701e7d6d9b99aaa1fc6a765937b736' into clippyup
Diffstat (limited to 'src/tools/clippy/tests/ui-toml')
-rw-r--r--src/tools/clippy/tests/ui-toml/toml_disallowed_method/clippy.toml2
-rw-r--r--src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.rs3
-rw-r--r--src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.stderr16
-rw-r--r--src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr2
4 files changed, 14 insertions, 9 deletions
diff --git a/src/tools/clippy/tests/ui-toml/toml_disallowed_method/clippy.toml b/src/tools/clippy/tests/ui-toml/toml_disallowed_method/clippy.toml
index a1f515e443d..c0df3b6e8af 100644
--- a/src/tools/clippy/tests/ui-toml/toml_disallowed_method/clippy.toml
+++ b/src/tools/clippy/tests/ui-toml/toml_disallowed_method/clippy.toml
@@ -1 +1 @@
-disallowed-methods = ["core::iter::traits::iterator::Iterator::sum", "regex::re_unicode::Regex::is_match"]
+disallowed-methods = ["core::iter::traits::iterator::Iterator::sum", "regex::re_unicode::Regex::is_match", "regex::re_unicode::Regex::new"]
diff --git a/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.rs b/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.rs
index 3d3f0729abd..1901a99377e 100644
--- a/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.rs
+++ b/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.rs
@@ -4,10 +4,9 @@ extern crate regex;
 use regex::Regex;
 
 fn main() {
-    let a = vec![1, 2, 3, 4];
     let re = Regex::new(r"ab.*c").unwrap();
-
     re.is_match("abc");
 
+    let a = vec![1, 2, 3, 4];
     a.iter().sum::<i32>();
 }
diff --git a/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.stderr b/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.stderr
index ed91b5a6796..2b628c67fa7 100644
--- a/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.stderr
+++ b/src/tools/clippy/tests/ui-toml/toml_disallowed_method/conf_disallowed_method.stderr
@@ -1,16 +1,22 @@
+error: use of a disallowed method `regex::re_unicode::Regex::new`
+  --> $DIR/conf_disallowed_method.rs:7:14
+   |
+LL |     let re = Regex::new(r"ab.*c").unwrap();
+   |              ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::disallowed-method` implied by `-D warnings`
+
 error: use of a disallowed method `regex::re_unicode::Regex::is_match`
-  --> $DIR/conf_disallowed_method.rs:10:5
+  --> $DIR/conf_disallowed_method.rs:8:5
    |
 LL |     re.is_match("abc");
    |     ^^^^^^^^^^^^^^^^^^
-   |
-   = note: `-D clippy::disallowed-method` implied by `-D warnings`
 
 error: use of a disallowed method `core::iter::traits::iterator::Iterator::sum`
-  --> $DIR/conf_disallowed_method.rs:12:5
+  --> $DIR/conf_disallowed_method.rs:11:5
    |
 LL |     a.iter().sum::<i32>();
    |     ^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr b/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
index 7b3c476461d..7ccd0b54845 100644
--- a/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
+++ b/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
@@ -1,4 +1,4 @@
-error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of `msrv`, `blacklisted-names`, `cognitive-complexity-threshold`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `verbose-bit-mask-threshold`, `literal-representation-threshold`, `trivial-copy-size-limit`, `pass-by-value-size-limit`, `too-many-lines-threshold`, `array-size-threshold`, `vec-box-size-threshold`, `max-trait-bounds`, `max-struct-bools`, `max-fn-params-bools`, `warn-on-all-wildcard-imports`, `disallowed-methods`, `unreadable-literal-lint-fractions`, `third-party` at line 5 column 1
+error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of `msrv`, `blacklisted-names`, `cognitive-complexity-threshold`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `verbose-bit-mask-threshold`, `literal-representation-threshold`, `trivial-copy-size-limit`, `pass-by-value-size-limit`, `too-many-lines-threshold`, `array-size-threshold`, `vec-box-size-threshold`, `max-trait-bounds`, `max-struct-bools`, `max-fn-params-bools`, `warn-on-all-wildcard-imports`, `disallowed-methods`, `unreadable-literal-lint-fractions`, `cargo-ignore-publish`, `third-party` at line 5 column 1
 
 error: aborting due to previous error