diff options
Diffstat (limited to 'tests/ui/lifetimes/struct-lifetime-inference-15735.rs')
| -rw-r--r-- | tests/ui/lifetimes/struct-lifetime-inference-15735.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/struct-lifetime-inference-15735.rs b/tests/ui/lifetimes/struct-lifetime-inference-15735.rs new file mode 100644 index 00000000000..39e619648eb --- /dev/null +++ b/tests/ui/lifetimes/struct-lifetime-inference-15735.rs @@ -0,0 +1,19 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/15735 + +//@ check-pass +#![allow(dead_code)] +struct A<'a> { + a: &'a i32, + b: &'a i32, +} + +impl <'a> A<'a> { + fn foo<'b>(&'b self) { + A { + a: self.a, + b: self.b, + }; + } +} + +fn main() { } |
