From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/traits/inheritance/cross-trait-call-xc.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/traits/inheritance/cross-trait-call-xc.rs (limited to 'tests/ui/traits/inheritance/cross-trait-call-xc.rs') 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); +} -- cgit v1.2.3