about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-toml/toml_unloaded_crate/clippy.toml10
-rw-r--r--tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.rs6
-rw-r--r--tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr16
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/ui-toml/toml_unloaded_crate/clippy.toml b/tests/ui-toml/toml_unloaded_crate/clippy.toml
new file mode 100644
index 00000000000..e664256d2a2
--- /dev/null
+++ b/tests/ui-toml/toml_unloaded_crate/clippy.toml
@@ -0,0 +1,10 @@
+# The first two `disallowed-methods` paths should generate warnings, but the third should not.
+
+[[disallowed-methods]]
+path = "regex::Regex::new_"
+
+[[disallowed-methods]]
+path = "regex::Regex_::new"
+
+[[disallowed-methods]]
+path = "regex_::Regex::new"
diff --git a/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.rs b/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.rs
new file mode 100644
index 00000000000..2dbc5eca32e
--- /dev/null
+++ b/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.rs
@@ -0,0 +1,6 @@
+//@error-in-other-file: `regex::Regex::new_` does not refer to an existing function
+//@error-in-other-file: `regex::Regex_::new` does not refer to an existing function
+
+extern crate regex;
+
+fn main() {}
diff --git a/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr b/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr
new file mode 100644
index 00000000000..5d28e5fa970
--- /dev/null
+++ b/tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr
@@ -0,0 +1,16 @@
+warning: `regex::Regex::new_` does not refer to an existing function
+  --> $DIR/tests/ui-toml/toml_unloaded_crate/clippy.toml:3:1
+   |
+LL | / [[disallowed-methods]]
+LL | | path = "regex::Regex::new_"
+   | |___________________________^
+
+warning: `regex::Regex_::new` does not refer to an existing function
+  --> $DIR/tests/ui-toml/toml_unloaded_crate/clippy.toml:6:1
+   |
+LL | / [[disallowed-methods]]
+LL | | path = "regex::Regex_::new"
+   | |___________________________^
+
+warning: 2 warnings emitted
+