]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/traits/inheritance/cross-trait-call-xc.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / traits / inheritance / cross-trait-call-xc.rs
diff --git a/src/test/ui/traits/inheritance/cross-trait-call-xc.rs b/src/test/ui/traits/inheritance/cross-trait-call-xc.rs
new file mode 100644 (file)
index 0000000..99fbb5c
--- /dev/null
@@ -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);
+}