summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/inheritance/cross-trait-call-xc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/inheritance/cross-trait-call-xc.rs')
-rw-r--r--tests/ui/traits/inheritance/cross-trait-call-xc.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/traits/inheritance/cross-trait-call-xc.rs b/tests/ui/traits/inheritance/cross-trait-call-xc.rs
new file mode 100644
index 000000000..99fbb5c61
--- /dev/null
+++ b/tests/ui/traits/inheritance/cross-trait-call-xc.rs
@@ -0,0 +1,20 @@
+// run-pass
+// aux-build:xc_call.rs
+
+
+extern crate xc_call as aux;
+
+use aux::Foo;
+
+trait Bar : Foo {
+ fn g(&self) -> isize;
+}
+
+impl Bar for aux::A {
+ fn g(&self) -> isize { self.f() }
+}
+
+pub fn main() {
+ let a = &aux::A { x: 3 };
+ assert_eq!(a.g(), 10);
+}