about summary refs log tree commit diff
path: root/tests/ui/delegation/explicit-paths.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/delegation/explicit-paths.rs')
-rw-r--r--tests/ui/delegation/explicit-paths.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/delegation/explicit-paths.rs b/tests/ui/delegation/explicit-paths.rs
new file mode 100644
index 00000000000..1feaaa73f79
--- /dev/null
+++ b/tests/ui/delegation/explicit-paths.rs
@@ -0,0 +1,25 @@
+#![feature(fn_delegation)]
+//~^ WARN the feature `fn_delegation` is incomplete
+
+trait Trait {
+    fn bar(&self) -> i32 { 42 }
+}
+
+struct F;
+impl Trait for F {}
+
+struct S(F);
+
+impl Trait for S {
+    reuse <F as Trait>::bar;
+    //~^ ERROR mismatched types
+}
+
+struct S2(F);
+
+impl Trait for S2 {
+    reuse <S2 as Trait>::bar { &self.0 }
+    //~^ ERROR mismatched types
+}
+
+fn main() {}