diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-20414.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-20414.rs b/src/test/ui/issues/issue-20414.rs new file mode 100644 index 000000000..2496e342a --- /dev/null +++ b/src/test/ui/issues/issue-20414.rs @@ -0,0 +1,21 @@ +// check-pass +#![allow(dead_code)] +// pretty-expanded FIXME #23616 + +trait Trait { + fn method(self) -> isize; +} + +struct Wrapper<T> { + field: T +} + +impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait { + fn method(self) -> isize { + let r: &'a T = &self.field; + Trait::method(r); // these should both work + r.method() + } +} + +fn main() {} |