summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-types-in-ambiguous-context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/associated-types-in-ambiguous-context.rs')
-rw-r--r--src/test/ui/associated-types/associated-types-in-ambiguous-context.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/associated-types-in-ambiguous-context.rs b/src/test/ui/associated-types/associated-types-in-ambiguous-context.rs
new file mode 100644
index 000000000..51b53908f
--- /dev/null
+++ b/src/test/ui/associated-types/associated-types-in-ambiguous-context.rs
@@ -0,0 +1,29 @@
+trait Get {
+ type Value;
+ fn get(&self) -> <Self as Get>::Value;
+}
+
+fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
+//~^ ERROR ambiguous associated type
+
+trait Grab {
+ type Value;
+ fn grab(&self) -> Grab::Value;
+ //~^ ERROR ambiguous associated type
+
+ fn get(&self) -> Get::Value;
+ //~^ ERROR ambiguous associated type
+}
+
+trait Bar {}
+
+trait Foo where Foo::Assoc: Bar {
+//~^ ERROR ambiguous associated type
+ type Assoc;
+}
+
+type X = std::ops::Deref::Target;
+//~^ ERROR ambiguous associated type
+
+fn main() {
+}