about summary refs log tree commit diff
path: root/tests/ui/resolve
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2023-04-03 21:30:13 +0100
committerclubby789 <jamie@hill-daniel.co.uk>2023-04-04 14:10:13 +0100
commitebde2ab363ea4cfff4fbb58ef821f3bcebc351a5 (patch)
treedf0f5ee47767c2565ec299fac4a7a1c2f4d2bbaa /tests/ui/resolve
parent17675855094906ba90aca2f119be8fb7afc4d456 (diff)
downloadrust-ebde2ab363ea4cfff4fbb58ef821f3bcebc351a5.tar.gz
rust-ebde2ab363ea4cfff4fbb58ef821f3bcebc351a5.zip
Deny `use`ing tool paths
Diffstat (limited to 'tests/ui/resolve')
-rw-r--r--tests/ui/resolve/tool-import.rs8
-rw-r--r--tests/ui/resolve/tool-import.stderr9
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/resolve/tool-import.rs b/tests/ui/resolve/tool-import.rs
new file mode 100644
index 00000000000..971993332f5
--- /dev/null
+++ b/tests/ui/resolve/tool-import.rs
@@ -0,0 +1,8 @@
+// edition: 2018
+
+use clippy::time::Instant;
+//~^ `clippy` is a tool module
+
+fn main() {
+    Instant::now();
+}
diff --git a/tests/ui/resolve/tool-import.stderr b/tests/ui/resolve/tool-import.stderr
new file mode 100644
index 00000000000..d3bdfc93d49
--- /dev/null
+++ b/tests/ui/resolve/tool-import.stderr
@@ -0,0 +1,9 @@
+error[E0433]: failed to resolve: `clippy` is a tool module, not a module
+  --> $DIR/tool-import.rs:3:5
+   |
+LL | use clippy::time::Instant;
+   |     ^^^^^^ `clippy` is a tool module, not a module
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.