about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-02-27 08:48:50 -0700
committerMichael Howell <michael@notriddle.com>2023-02-27 09:22:51 -0700
commitf058bb0fcfeef3ebb0da19b2399f575c3aa9c3e8 (patch)
tree27aac62b2cab6d91b454ab44e41ec207d25685db /tests
parent49b9cc5139dd4d11ef78dc08c1f9170de5b1ca39 (diff)
downloadrust-f058bb0fcfeef3ebb0da19b2399f575c3aa9c3e8.tar.gz
rust-f058bb0fcfeef3ebb0da19b2399f575c3aa9c3e8.zip
diagnostics: avoid querying `associated_item` in the resolver
Fixes #108529
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/resolve/issue-108529.rs8
-rw-r--r--tests/ui/resolve/issue-108529.stderr9
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/resolve/issue-108529.rs b/tests/ui/resolve/issue-108529.rs
new file mode 100644
index 00000000000..8e3aafab6aa
--- /dev/null
+++ b/tests/ui/resolve/issue-108529.rs
@@ -0,0 +1,8 @@
+#![allow(nonstandard_style)]
+use f::f::f; //~ ERROR
+
+trait f {
+    extern "C" fn f();
+}
+
+fn main() {}
diff --git a/tests/ui/resolve/issue-108529.stderr b/tests/ui/resolve/issue-108529.stderr
new file mode 100644
index 00000000000..cf4e4759c37
--- /dev/null
+++ b/tests/ui/resolve/issue-108529.stderr
@@ -0,0 +1,9 @@
+error[E0432]: unresolved import `f::f`
+  --> $DIR/issue-108529.rs:2:8
+   |
+LL | use f::f::f;
+   |        ^ expected type, found associated function `f` in `f`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0432`.