about summary refs log tree commit diff
path: root/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/not-suggest-non-existing-fully-qualified-path.rs')
-rw-r--r--tests/ui/traits/not-suggest-non-existing-fully-qualified-path.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.rs b/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.rs
new file mode 100644
index 00000000000..538e74ee1b0
--- /dev/null
+++ b/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.rs
@@ -0,0 +1,24 @@
+struct A<T>(T);
+struct B;
+
+trait I<T> {}
+impl I<i32> for B {}
+impl I<u32> for B {}
+
+trait V<U> {
+    fn method(self) -> U;
+}
+
+impl<T, U> V<U> for A<T>
+where
+    T: I<U>,
+{
+    fn method(self) -> U { unimplemented!() }
+}
+
+fn main() {
+    let a = A(B);
+    a.method();
+    //~^ ERROR type annotations needed
+    //~| ERROR type annotations needed
+}